Class ComparableTermBasedProposition<T>

java.lang.Object
org.kuali.rice.krms.framework.engine.ComparableTermBasedProposition<T>
Type Parameters:
T -
All Implemented Interfaces:
Proposition
Direct Known Subclasses:
CollectionOfComparablesTermBasedProposition, StringTermBasedProposition

public class ComparableTermBasedProposition<T> extends Object implements Proposition
An implementation of Proposition which uses a ComparisonOperator and Term
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • ComparableTermBasedProposition

      public ComparableTermBasedProposition(ComparisonOperator operator, org.kuali.rice.krms.api.engine.Term term, T expectedValue)
      Create a ComparableTermBasedProposition with the given values
      Parameters:
      operator - ComparisonOperator to set the operator to
      term - Term to set the term to
      expectedValue - to set the expectedValue to
  • Method Details

    • evaluate

      public PropositionResult evaluate(org.kuali.rice.krms.api.engine.ExecutionEnvironment environment)
      Description copied from interface: Proposition
      Evaluates this proposition -- and in the case of Propositions containing children, those children as well -- and returns the boolean result;
      Specified by:
      evaluate in interface Proposition
      Parameters:
      environment - the ExecutionEnvironment that this Proposition is running in
      Returns:
      the boolean result of evaluation
      Throws:
      org.kuali.rice.krms.api.engine.TermResolutionException - if there is a problem resolving the Term
      See Also:
    • compare

      protected boolean compare(Comparable<T> termValue)
      Compares the term value w/ the expected value
      Parameters:
      termValue - Comparable which makes up the ComparisonOperator.compare() left hand side object
      Returns:
      the boolean result of the comparison
    • getChildren

      public List<Proposition> getChildren()
      Returns an empty list. Collections.emptyList() Returns the List of child Propositions that belong to this object. If there are no children (e.g. for simple Proposition types), this must return an empty List.
      Specified by:
      getChildren in interface Proposition
      Returns:
      an empty list. Collections.emptyList()
    • isCompound

      public boolean isCompound()
      Description copied from interface: Proposition
      Indicates whether this Proposition can have children.
      Specified by:
      isCompound in interface Proposition
      Returns:
      true if this Proposition can contain child Propositions.
    • getExpectedValue

      protected T getExpectedValue()
      Returns the expectedValue
      Returns:
      the expectedValue
    • toString

      public String toString()
      Overrides:
      toString in class Object