Package org.springframework.aot.hint.predicate

# Class ReflectionHintsPredicates

java.lang.Object
org.springframework.aot.hint.predicate.ReflectionHintsPredicates

public class ReflectionHintsPredicates extends Object
Generator of `ReflectionHints` predicates, testing whether the given hints match the expected behavior for reflection.

Since:
  6.0
Author:
  Brian Clozel, Stephane Nicoll

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`ReflectionHintsPredicates.ConstructorHintPredicate`
`static class`
`ReflectionHintsPredicates.ExecutableHintPredicate<T extends Executable>`
`static class`
`ReflectionHintsPredicates.FieldHintPredicate`
`static class`
`ReflectionHintsPredicates.MethodHintPredicate`
`static class`
`ReflectionHintsPredicates.TypeHintPredicate`

## Method Summary

Modifier and Type
Method
Description
`ReflectionHintsPredicates.ConstructorHintPredicate`
`onConstructor(Constructor<?> constructor)`
Return a predicate that checks whether a reflection hint is registered for the given constructor.
`ReflectionHintsPredicates.FieldHintPredicate`
`onField(Class<?> type, String fieldName)`
Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector.
`ReflectionHintsPredicates.FieldHintPredicate`
`onField(Field field)`
Return a predicate that checks whether a reflective field access hint is registered for the given field.
`ReflectionHintsPredicates.FieldHintPredicate`
`onField(String className, String fieldName)`
Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector.
`ReflectionHintsPredicates.MethodHintPredicate`
`onMethod(Class<?> type, String methodName)`
Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector.
`ReflectionHintsPredicates.MethodHintPredicate`
`onMethod(Method method)`
Return a predicate that checks whether a reflection hint is registered for the given method.
`ReflectionHintsPredicates.MethodHintPredicate`
`onMethod(String className, String methodName)`
Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector.
`ReflectionHintsPredicates.TypeHintPredicate`
`onType(Class<?> type)`
Return a predicate that checks whether a reflection hint is registered for the given type.
`ReflectionHintsPredicates.TypeHintPredicate`
`onType(TypeReference typeReference)`
Return a predicate that checks whether a reflection hint is registered for the given type.

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

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

## Method Details

### onType

public ReflectionHintsPredicates.TypeHintPredicate onType(TypeReference typeReference)
Return a predicate that checks whether a reflection hint is registered for the given type.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `typeReference` - the type
Returns:
  the `RuntimeHints` predicate

### onType

public ReflectionHintsPredicates.TypeHintPredicate onType(Class<?> type)
Return a predicate that checks whether a reflection hint is registered for the given type.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `type` - the type
Returns:
  the `RuntimeHints` predicate

### onConstructor

public ReflectionHintsPredicates.ConstructorHintPredicate onConstructor(Constructor<?> constructor)
Return a predicate that checks whether a reflection hint is registered for the given constructor. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `constructor` - the constructor
Returns:
  the `RuntimeHints` predicate

### onMethod

public ReflectionHintsPredicates.MethodHintPredicate onMethod(Method method)
Return a predicate that checks whether a reflection hint is registered for the given method. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `method` - the method
Returns:
  the `RuntimeHints` predicate

### onMethod

public ReflectionHintsPredicates.MethodHintPredicate onMethod(Class<?> type, String methodName)
Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector. This looks up a method on the given type with the expected name, if unique. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `type` - the type holding the method
  `methodName` - the method name
Returns:
  the `RuntimeHints` predicate
Throws:
  `IllegalArgumentException` - if the method cannot be found or if multiple methods are found with the same name.

### onMethod

public ReflectionHintsPredicates.MethodHintPredicate onMethod(String className, String methodName) throws ClassNotFoundException
Return a predicate that checks whether a reflection hint is registered for the method that matches the given selector. This looks up a method on the given type with the expected name, if unique. By default, both introspection and invocation hints match.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `className` - the name of the class holding the method
  `methodName` - the method name
Returns:
  the `RuntimeHints` predicate
Throws:
  `ClassNotFoundException` - if the class cannot be resolved.
  `IllegalArgumentException` - if the method cannot be found or if multiple methods are found with the same name.

### onField

public ReflectionHintsPredicates.FieldHintPredicate onField(Class<?> type, String fieldName)
Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector. This looks up a field on the given type with the expected name, if present. By default, unsafe or write access is not considered.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `type` - the type holding the field
  `fieldName` - the field name
Returns:
  the `RuntimeHints` predicate
Throws:
  `IllegalArgumentException` - if a field cannot be found with the given name.

### onField

public ReflectionHintsPredicates.FieldHintPredicate onField(String className, String fieldName) throws ClassNotFoundException
Return a predicate that checks whether a reflection hint is registered for the field that matches the given selector. This looks up a field on the given type with the expected name, if present. By default, unsafe or write access is not considered.

The returned type exposes additional methods that refine the predicate behavior.

Parameters:
  `className` - the name of the class holding the field
  `fieldName` - the field name
Returns:
  the `RuntimeHints` predicate
Throws:
  `ClassNotFoundException` - if the class cannot be resolved.
  `IllegalArgumentException` - if a field cannot be found with the given name.

### onField

public ReflectionHintsPredicates.FieldHintPredicate onField(Field field)
Return a predicate that checks whether a reflective field access hint is registered for the given field.

Parameters:
  `field` - the field
Returns:
  the `RuntimeHints` predicate