Package org.springframework.aot.hint

# 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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`TypeHint.Builder`
Builder for `TypeHint`.

## Method Summary

Modifier and Type
Method
Description
`static Consumer<TypeHint.Builder>`
`builtWith(MemberCategory... memberCategories)`
Return a `Consumer` that applies the given `MemberCategories` to the accepted `TypeHint.Builder`.
`Stream<ExecutableHint>`
`constructors()`
Return the constructors that require reflection.
`Stream<FieldHint>`
`fields()`
Return the fields that require reflection.
`Set<MemberCategory>`
`getMemberCategories()`
Return the member categories that apply.
`TypeReference`
`getReachableType()`
Return the type that should be reachable for this hint to apply, or `null` if this hint should always been applied.
`TypeReference`
`getType()`
Return the type that this hint handles.
`Stream<ExecutableHint>`
`methods()`
Return the methods that require reflection.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.aot.hint.ConditionalHint

`conditionMatches`

## Method Details

### getType

public TypeReference getType()
Return the type that this hint handles.

Returns:
  the type

### getReachableType

@Nullable public 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

### 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