Class AbstractEvaluableMetadataCriterion<T>

java.lang.Object
net.shibboleth.oidc.metadata.AbstractEvaluableMetadataCriterion<T>
Type Parameters:
T - The metadata type this criterion accepts.
All Implemented Interfaces:
Predicate<T>, Criterion

public abstract class AbstractEvaluableMetadataCriterion<T> extends Object implements Predicate<T>, Criterion
Base class for all metadata criterion classes. If the correct object type this criterion accepts is not provided, test(Object) returns (defaultResultOnWrongType).
  • Field Details

    • objectType

      @Nonnull private final Class<T> objectType
      Object type.
    • defaultResultOnWrongType

      private final boolean defaultResultOnWrongType
      What should the default return type be if the wrong type is supplied.
  • Constructor Details

    • AbstractEvaluableMetadataCriterion

      protected AbstractEvaluableMetadataCriterion(@Nonnull Class<T> claz, boolean defaultResult)
      Constructor.
      Parameters:
      claz - the class this criterion accepts.
      defaultResult - what should be returned if the criterion is not appropriate for the given type.
  • Method Details

    • getType

      @Nonnull public Class<T> getType()
      Get the object type this criterion accepts.
      Returns:
      the object type.
    • test

      public boolean test(T t)
      Specified by:
      test in interface Predicate<T>
    • doTest

      public abstract boolean doTest(T metadata)
      Evaluates the predicate on the given argument. Concrete implementations should override this method.
      Parameters:
      metadata - the metadata.
      Returns:
      true if the predicate is true, false otherwise.