Package org.springframework.aot.hint
Class TypeHint.Builder
java.lang.Object
org.springframework.aot.hint.TypeHint.Builder
- Enclosing class:
- TypeHint
Builder for
TypeHint.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create aTypeHintbased on the state of this builder.onReachableType(TypeReference reachableType) Make this hint conditional on the fact that the specified type can be resolved.withConstructor(List<TypeReference> parameterTypes, Consumer<ExecutableHint.Builder> constructorHint) Register the need for reflection on the constructor with the specified parameter types.withField(String name, Consumer<FieldHint.Builder> fieldHint) Register the need for reflection on the field with the specified name.withMembers(MemberCategory... memberCategories) Adds the specified member categories.withMethod(String name, List<TypeReference> parameterTypes, Consumer<ExecutableHint.Builder> methodHint) Register the need for reflection on the method with the specified name and parameter types.
-
Constructor Details
-
Builder
-
-
Method Details
-
onReachableType
Make this hint conditional on the fact that the specified type can be resolved.- Parameters:
reachableType- the type that should be reachable for this hint to apply- Returns:
this, to facilitate method chaining
-
withField
Register the need for reflection on the field with the specified name.- Parameters:
name- the name of the fieldfieldHint- a builder to further customize the hints of this field- Returns:
this, to facilitate method chaining
-
withConstructor
public TypeHint.Builder withConstructor(List<TypeReference> parameterTypes, Consumer<ExecutableHint.Builder> constructorHint) Register the need for reflection on the constructor with the specified parameter types.- Parameters:
parameterTypes- the parameter types of the constructorconstructorHint- a builder to further customize the hints of this constructor- Returns:
this, to facilitate method chaining
-
withMethod
public TypeHint.Builder withMethod(String name, List<TypeReference> parameterTypes, Consumer<ExecutableHint.Builder> methodHint) Register the need for reflection on the method with the specified name and parameter types.- Parameters:
name- the name of the methodparameterTypes- the parameter types of the constructormethodHint- a builder to further customize the hints of this method- Returns:
this, to facilitate method chaining
-
withMembers
Adds the specified member categories.- Parameters:
memberCategories- the categories to apply- Returns:
this, to facilitate method chaining
-
build
Create aTypeHintbased on the state of this builder.- Returns:
- a type hint
-