Add shortcut method to register multiple types hints
Closes gh-28339
This commit is contained in:
@@ -95,6 +95,19 @@ public class ReflectionHints {
|
||||
return registerType(TypeReference.of(type), typeHint);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register or customize reflection hints for the types defined by the
|
||||
* specified list of {@link TypeReference type references}. The specified
|
||||
* {@code typeHint} consumer is invoked for each type.
|
||||
* @param types the types to customize
|
||||
* @param typeHint a builder to further customize hints for each type
|
||||
* @return {@code this}, to facilitate method chaining
|
||||
*/
|
||||
public ReflectionHints registerTypes(Iterable<TypeReference> types, Consumer<TypeHint.Builder> typeHint) {
|
||||
types.forEach(type -> registerType(type, typeHint));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the need for reflection on the specified {@link Field}.
|
||||
* @param field the field that requires reflection
|
||||
|
||||
Reference in New Issue
Block a user