Class TypeHint

java.lang.Object
org.springframework.aot.hint.TypeHint
All Implemented Interfaces:
ConditionalHint

public final class TypeHint extends Object implements ConditionalHint
A hint that describes the need for reflection on a type.
Since:
6.0
Author:
Stephane Nicoll, Phillip Webb, Andy Wilkinson
  • Method Details

    • getType

      public TypeReference getType()
      Return the type that this hint handles.
      Returns:
      the type
    • getReachableType

      public @Nullable TypeReference getReachableType()
      Description copied from interface: ConditionalHint
      Return the type that should be reachable for this hint to apply, or null if this hint should always been applied.
      Specified by:
      getReachableType in interface ConditionalHint
      Returns:
      the reachable type, if any
    • fields

      public Stream<FieldHint> fields()
      Return the fields that require reflection.
      Returns:
      a stream of FieldHint
    • constructors

      public Stream<ExecutableHint> constructors()
      Return the constructors that require reflection.
      Returns:
      a stream of ExecutableHint
    • methods

      public Stream<ExecutableHint> methods()
      Return the methods that require reflection.
      Returns:
      a stream of ExecutableHint
    • getMemberCategories

      public Set<MemberCategory> getMemberCategories()
      Return the member categories that apply.
      Returns:
      the member categories to enable
    • hasJavaSerialization

      public boolean hasJavaSerialization()
      Return whether this hint registers the type for Java serialization.
      Returns:
      whether the type is registered for Java serialization
      Since:
      7.0.6
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builtWith

      public static Consumer<TypeHint.Builder> builtWith(MemberCategory... memberCategories)
      Return a Consumer that applies the given MemberCategories to the accepted TypeHint.Builder.
      Parameters:
      memberCategories - the memberCategories to apply
      Returns:
      a consumer to apply the member categories