Enum Class ComparisonOperator

java.lang.Object
java.lang.Enum<ComparisonOperator>
org.kuali.rice.krms.framework.engine.expression.ComparisonOperator
All Implemented Interfaces:
Serializable, Comparable<ComparisonOperator>, Constable, org.kuali.rice.core.api.mo.common.Coded

public enum ComparisonOperator extends Enum<ComparisonOperator> implements org.kuali.rice.core.api.mo.common.Coded
Operators enumeration for comparing objects. EQUALS NOT_EQUALS GREATER_THAN GREATER_THAN_EQUAL LESS_THAN LESS_THAN_EQUAL. Uses registered EngineComparatorExtension for the given objects or the DefaultComparisonOperator.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Enum Constant Details

  • Field Details

    • OPERATOR_CODES

      public static final Collection<String> OPERATOR_CODES
      Operator codes, unmodifiable Collection
    • OPERATOR_NAMES

      public static final Collection<String> OPERATOR_NAMES
      Operator names, unmodifiable Collection
  • Method Details

    • values

      public static ComparisonOperator[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ComparisonOperator valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getCode

      public String getCode()
      Specified by:
      getCode in interface org.kuali.rice.core.api.mo.common.Coded
      Returns:
      code representing the type of operator
    • fromCode

      public static ComparisonOperator fromCode(String code)
      Create a ComparisonOperator from the given code
      Parameters:
      code - for type of ComparisonOperator to create
      Returns:
      a ComparisonOperator created with the given code.
      Throws:
      IllegalArgumentException - if the given code does not exist
    • compare

      public boolean compare(Object lhs, Object rhs)
      Compare the given objects
      Parameters:
      lhs - left hand side object
      rhs - right hand side object
      Returns:
      boolean value of comparison results based on the type of operator.
    • setComparisonOperatorService

      public void setComparisonOperatorService(org.kuali.rice.krms.api.engine.expression.ComparisonOperatorService comparisonOperatorService)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ComparisonOperator>
      Returns:
      type code