Class ResourceHintsPredicates

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

public class ResourceHintsPredicates extends Object
Generator of ResourceHints predicates, testing whether the given hints match the expected behavior for resources.
Since:
6.0
Author:
Brian Clozel, Stephane Nicoll
  • Method Details

    • forBundle

      public Predicate<RuntimeHints> forBundle(String bundleName)
      Return a predicate that checks whether a resource hint is registered for the given bundle name.
      Parameters:
      bundleName - the resource bundle name
      Returns:
      the RuntimeHints predicate
    • forResource

      public Predicate<RuntimeHints> forResource(TypeReference type, String resourceName)
      Return a predicate that checks whether a resource hint is registered for the given resource name, located in the given type's package.

      For example, forResource(org.example.MyClass, "myResource.txt") will match for "/org/example/myResource.txt".

      Parameters:
      type - the type's package where to look for the resource
      resourceName - the resource name
      Returns:
      the RuntimeHints predicate
    • forResource

      public Predicate<RuntimeHints> forResource(String resourceName)
      Return a predicate that checks whether a resource hint is registered for the given resource name.
      Parameters:
      resourceName - the full resource name
      Returns:
      the RuntimeHints predicate