Package org.springframework.aot.hint

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

Modifier and Type
Method
Description
`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.
`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.
`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`.
`TypeHint.Builder`
`withField(String name)`
Register the need for reflective access on the field with the specified name.
`TypeHint.Builder`
`withMembers(MemberCategory... memberCategories)`
Adds the specified member categories.
`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`.

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

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

## 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 reflective access on the field with the specified name.

Parameters:
  `name` - the name of the field
Returns:
  `this`, to facilitate method chaining
See Also:
  - `Field.get(Object)`
  - `Field.set(Object, Object)`

### 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:
  - `TypeHint.builtWith(MemberCategory...)`