All Implemented Interfaces:
Provider<Mask>, ProviderAsStack
Direct Known Subclasses:
IfKeyValueCondition, IfNotEmpty, IfObjectFilter, IfStackExists

public abstract class IfPredicateBase extends MaskProviderUnary
Base class which multiplexes between the current mask and an alternative depending if a condition is met.

This class extends MaskProviderUnary to provide a mechanism for conditional mask selection.

  • Constructor Details

    • IfPredicateBase

      public IfPredicateBase()
  • Method Details

    • createFromMask

      protected Mask createFromMask(Mask mask) throws ProvisionFailedException
      Description copied from class: MaskProviderUnary
      Creates a Mask given the entity provided by the delegate.
      Specified by:
      createFromMask in class MaskProviderUnary
      Parameters:
      mask - the entity provided by the delegate.
      Returns:
      the created Mask that is returned by the provider.
      Throws:
      ProvisionFailedException - if the provider cannot complete successfully.
    • predicate

      protected abstract boolean predicate(Mask mask) throws ProvisionFailedException
      Evaluates a predicate condition on the input mask.
      Parameters:
      mask - the input Mask to evaluate
      Returns:
      true if the predicate condition is satisfied, false otherwise
      Throws:
      ProvisionFailedException - if there's an error during predicate evaluation
    • getMaskElse

      public MaskProvider getMaskElse()
      Returned instead of mask if the predicate is not satisfied.

      This MaskProvider is used to generate an alternative mask when the predicate condition is not met.

    • setMaskElse

      public void setMaskElse(MaskProvider maskElse)
      Returned instead of mask if the predicate is not satisfied.

      This MaskProvider is used to generate an alternative mask when the predicate condition is not met.