Class PolicyFromMatcherId

All Implemented Interfaces:
PolicyRequirementRule, Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent

public final class PolicyFromMatcherId extends BaseBridgingClass implements PolicyRequirementRule, IdentifiedComponent, DestructableComponent
Bridging class to go from a Matcher to a PolicyRequirementRule.

If the value of the supplied attribute matches then this is true, otherwise false.

  • Field Details

    • theMatcher

      private final Matcher theMatcher
      The rule we are shadowing.
    • attributeId

      private final String attributeId
      The attribute Id we care about.
    • log

      private final org.slf4j.Logger log
      Class logger.
  • Constructor Details

    • PolicyFromMatcherId

      public PolicyFromMatcherId(@Nonnull @ParameterName(name="matcher") Matcher matcher, @Nonnull @NotEmpty @ParameterName(name="attribute") String attribute)
      Constructor.
      Parameters:
      matcher - the class we are bridging to
      attribute - the Id of the attribute in question.
  • Method Details

    • getAttributeId

      @Nonnull public String getAttributeId()
      Gets the Id of the attribute in question.
      Returns:
      the id.
    • getMatcher

      @Nonnull public Matcher getMatcher()
      Testing support. Get the embedded matcher.
      Returns:
      the embedded matcher.
    • matches

      @Nonnull public PolicyRequirementRule.Tristate matches(@Nonnull AttributeFilterContext context)
      Evaluate what this rule means.
      Specified by:
      matches in interface PolicyRequirementRule
      Parameters:
      context - the context.
      Returns:
      whether the rule holds