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.
  • Method Details

    • onReachableType

      public TypeHint.Builder onReachableType(TypeReference reachableType)
      Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.
      Parameters:
      reachableType - the type that should be reachable for this hint to apply
      Returns:
      this, to facilitate method chaining
    • onReachableType

      public TypeHint.Builder onReachableType(Class<?> reachableType)
      Make this hint conditional on the fact that the specified type is in a reachable code path from a static analysis point of view.
      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)
      Register the need for reflection on the field with the specified name.
      Parameters:
      name - the name of the field
      Returns:
      this, to facilitate method chaining
    • withConstructor

      public TypeHint.Builder withConstructor(List<TypeReference> parameterTypes, ExecutableMode mode)
      Register the need for reflection on the constructor with the specified parameter types, using the specified ExecutableMode.
      Parameters:
      parameterTypes - the parameter types of the constructor
      mode - the requested mode
      Returns:
      this, to facilitate method chaining
    • withMethod

      public TypeHint.Builder withMethod(String name, List<TypeReference> parameterTypes, ExecutableMode mode)
      Register the need for reflection on the method with the specified name and parameter types, using the specified ExecutableMode.
      Parameters:
      name - the name of the method
      parameterTypes - the parameter types of the constructor
      mode - the requested mode
      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
      See Also: