Package org.springframework.aot.hint

# Interface ConditionalHint

All Known Implementing Classes:
  `JavaSerializationHint`, `JdkProxyHint`, `ResourceBundleHint`, `ResourcePatternHint`, `TypeHint`

public interface ConditionalHint
Contract for `runtime hints` that only apply if the described condition is met.

Since:
  6.0
Author:
  Brian Clozel

## Method Summary

Modifier and Type
Method
Description
`default boolean`
`conditionMatches(ClassLoader classLoader)`
Whether the condition described for this hint is met.
`TypeReference`
`getReachableType()`
Return the type that should be reachable for this hint to apply, or `null` if this hint should always been applied.

## Method Details

### getReachableType

@Nullable TypeReference getReachableType()
Return the type that should be reachable for this hint to apply, or `null` if this hint should always been applied.

Returns:
  the reachable type, if any

### conditionMatches

default boolean conditionMatches(ClassLoader classLoader)
Whether the condition described for this hint is met. If it is not, the hint does not apply.

Instead of checking for actual reachability of a type in the application, the classpath is checked for the presence of this type as a simple heuristic.

Parameters:
  `classLoader` - the current classloader
Returns:
  whether the condition is met and the hint applies