Class TypeHint.Builder

java.lang.Object
org.springframework.aot.hint.TypeHint.Builder
Enclosing class:
TypeHint

public static class TypeHint.Builder extends Object
Builder for TypeHint.
  • Constructor Details

  • Method Details

    • onReachableType

      public TypeHint.Builder onReachableType(TypeReference reachableType)
      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

      public TypeHint.Builder withField(String name, Consumer<FieldHint.Builder> fieldHint)
      Register the need for reflection on the field with the specified name.
      Parameters:
      name - the name of the field
      fieldHint - 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 constructor
      constructorHint - 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 method
      parameterTypes - the parameter types of the constructor
      methodHint - a builder to further customize the hints of this method
      Returns:
      this, to facilitate method chaining
    • withMembers

      public TypeHint.Builder withMembers(MemberCategory... memberCategories)
      Adds the specified member categories.
      Parameters:
      memberCategories - the categories to apply
      Returns:
      this, to facilitate method chaining
    • build

      public TypeHint build()
      Create a TypeHint based on the state of this builder.
      Returns:
      a type hint