Class Comparison

  • All Implemented Interfaces:
    Constraint, java.io.Serializable

    public class Comparison
    extends java.lang.Object
    implements Constraint
    This class represents a search condition in which to query information based on the comparison of a column to a value.
    Since:
    2.3
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Comparison.Operator
      The method with which to evaluate data that is compared to a value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Comparison caseInsensitive()
      Sets the comparison as case insensitive.
      Comparison caseSensitive()
      Sets the comparison as case-sensitive.
      Comparison column​(Column column)
      Sets the Column of the comparison.
      static Comparison comparison​(Column column, Comparison.Operator operator, java.io.Serializable value)
      Creates a Comparison object with the specified column, operator, and value.
      static Comparison comparison​(Column column, Comparison.Operator operator, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column, operator, value and indicates whether the comparison is case-sensitive.
      static Comparison equal​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the EQUAL operator.
      static Comparison equal​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the EQUAL operator, and indicates whether the comparison is case-sensitive.
      Column getColumn()
      Gets the column for the comparison.
      Comparison.Operator getOperator()
      Gets the operator for the comparison.
      java.io.Serializable getValue()
      Gets the value to compare.
      static Comparison greaterThan​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the GREATER_THAN operator.
      static Comparison greaterThan​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the GREATER_THAN operator, and indicates whether the comparison is case-sensitive.
      static Comparison greaterThanOrEqual​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator.
      static Comparison greaterThanOrEqual​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator, and indicates whether the comparison should be case-sensitive.
      boolean isCaseSensitive()
      Indicates whether the comparison is case-sensitive.
      static Comparison lessThan​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the LESS_THAN operator.
      static Comparison lessThan​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the LESS_THAN operator, and indicates whether the comparison is case-sensitive.
      static Comparison lessThanOrEqual​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator.
      static Comparison lessThanOrEqual​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator, and indicates whether the comparison is case-sensitive.
      static Comparison like​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the LIKE operator.
      static Comparison like​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the LIKE operator, and indicates whether the comparison is case-sensitive.
      static Comparison notEqual​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the NOT_EQUAL operator.
      static Comparison notEqual​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the NOT_EQUAL operator, and indicates whether the comparison is case-sensitive.
      static Comparison notLike​(Column column, java.io.Serializable value)
      Creates a Comparison object with the specified column and value using the NOT_LIKE operator.
      static Comparison notLike​(Column column, java.io.Serializable value, boolean caseSensitive)
      Creates a Comparison object with the specified column and value using the NOT_LIKE operator, and indicates whether the comparison is case-sensitive.
      Comparison operator​(Comparison.Operator o)
      Sets the Comparison.Operator of the comparison.
      void setCaseSensitive​(boolean caseSensitive)
      Sets whether the comparison is case-sensitive.
      void setColumn​(Column column)
      Sets the column for the comparison.
      void setOperator​(Comparison.Operator operator)
      Sets the operator for the comparison.
      void setValue​(java.io.Serializable value)
      Sets the value for comparison.
      java.lang.String toString()  
      Comparison value​(java.io.Serializable v)
      Sets the value of the comparison.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Comparison

        public Comparison​(Column column,
                          Comparison.Operator operator,
                          java.io.Serializable value)
        Constructor.
        Parameters:
        column - The column for the comparison.
        operator - The operator for the comparison.
        value - The value to compare.
      • Comparison

        public Comparison​(Column column,
                          Comparison.Operator operator,
                          java.io.Serializable value,
                          boolean caseSensitive)
        Constructor.
        Parameters:
        column - The column for the comparison.
        operator - The operator for the comparison.
        value - The value to compare.
        caseSensitive - Indicates whether the comparison is case-sensitive. The default is True.
    • Method Detail

      • getColumn

        public Column getColumn()
        Gets the column for the comparison.
        Returns:
        The column for the comparison.
      • setColumn

        public void setColumn​(Column column)
        Sets the column for the comparison.
        Parameters:
        column - The column for the comparison.
      • getOperator

        public Comparison.Operator getOperator()
        Gets the operator for the comparison.
        Returns:
        The operator for the comparison.
      • setOperator

        public void setOperator​(Comparison.Operator operator)
        Sets the operator for the comparison.
        Parameters:
        operator - The operator for the comparison.
      • getValue

        public java.io.Serializable getValue()
        Gets the value to compare.
        Returns:
        The value to compare.
      • setValue

        public void setValue​(java.io.Serializable value)
        Sets the value for comparison.
        Parameters:
        value - The value for comparison.
      • isCaseSensitive

        public boolean isCaseSensitive()
        Indicates whether the comparison is case-sensitive.
        Returns:
        A boolean value that indicates whether the comparison is case-sensitive.
      • setCaseSensitive

        public void setCaseSensitive​(boolean caseSensitive)
        Sets whether the comparison is case-sensitive. Default is True.
        Parameters:
        caseSensitive - Indicator of whether the comparison is case-sensitive. Default is True.
      • caseSensitive

        public Comparison caseSensitive()
        Sets the comparison as case-sensitive. If not explicitly set, the default comparison is case-sensitive.
        Returns:
        The updated Comparison object.
      • caseInsensitive

        public Comparison caseInsensitive()
        Sets the comparison as case insensitive. If not explicitly set, the default comparison is case-sensitive.
        Returns:
        The updated Comparison object.
      • column

        public Comparison column​(Column column)
        Sets the Column of the comparison.
        Returns:
        The updated Comparison object.
      • value

        public Comparison value​(java.io.Serializable v)
        Sets the value of the comparison.
        Returns:
        The updated Comparison object.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • comparison

        public static Comparison comparison​(Column column,
                                            Comparison.Operator operator,
                                            java.io.Serializable value)
        Creates a Comparison object with the specified column, operator, and value.
        Returns:
        A Comparison object with the specified column, operator, and value.
      • comparison

        public static Comparison comparison​(Column column,
                                            Comparison.Operator operator,
                                            java.io.Serializable value,
                                            boolean caseSensitive)
        Creates a Comparison object with the specified column, operator, value and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column, operator, value and indicates whether the comparison is case-sensitive.
      • equal

        public static Comparison equal​(Column column,
                                       java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the EQUAL operator.
        Returns:
        A Comparison object with the specified column and value using the EQUAL operator.
      • equal

        public static Comparison equal​(Column column,
                                       java.io.Serializable value,
                                       boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the EQUAL operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the EQUAL operator, and indicates whether the comparison is case-sensitive.
      • notEqual

        public static Comparison notEqual​(Column column,
                                          java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the NOT_EQUAL operator.
        Returns:
        A Comparison object with the specified column and value using the NOT_EQUAL operator.
      • notEqual

        public static Comparison notEqual​(Column column,
                                          java.io.Serializable value,
                                          boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the NOT_EQUAL operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the NOT_EQUAL operator, and indicates whether the comparison is case sensitive.
      • greaterThan

        public static Comparison greaterThan​(Column column,
                                             java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the GREATER_THAN operator.
        Returns:
        A Comparison object with the specified column and value using the GREATER_THAN operator.
      • greaterThan

        public static Comparison greaterThan​(Column column,
                                             java.io.Serializable value,
                                             boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the GREATER_THAN operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the GREATER_THAN operator, and indicates whether the comparison is case sensitive.
      • greaterThanOrEqual

        public static Comparison greaterThanOrEqual​(Column column,
                                                    java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator.
        Returns:
        A Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator.
      • greaterThanOrEqual

        public static Comparison greaterThanOrEqual​(Column column,
                                                    java.io.Serializable value,
                                                    boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator, and indicates whether the comparison should be case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the GREATER_THAN_OR_EQUAL operator, and indicates whether the comparison is case-sensitive.
      • lessThan

        public static Comparison lessThan​(Column column,
                                          java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the LESS_THAN operator.
        Returns:
        A Comparison object with the specified column and value using the LESS_THAN operator.
      • lessThan

        public static Comparison lessThan​(Column column,
                                          java.io.Serializable value,
                                          boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the LESS_THAN operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the LESS_THAN operator, and indicates whether the comparison is case-sensitive.
      • lessThanOrEqual

        public static Comparison lessThanOrEqual​(Column column,
                                                 java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator.
        Returns:
        A Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator.
      • lessThanOrEqual

        public static Comparison lessThanOrEqual​(Column column,
                                                 java.io.Serializable value,
                                                 boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the LESS_THAN_OR_EQUAL operator, and indicates whether the comparison should be case-sensitive.
      • like

        public static Comparison like​(Column column,
                                      java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the LIKE operator.
        Returns:
        A Comparison object with the specified column and value using the LIKE operator.
      • like

        public static Comparison like​(Column column,
                                      java.io.Serializable value,
                                      boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the LIKE operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the LIKE operator, and indicates whether the comparison is case-sensitive.
      • notLike

        public static Comparison notLike​(Column column,
                                         java.io.Serializable value)
        Creates a Comparison object with the specified column and value using the NOT_LIKE operator.
        Returns:
        A Comparison object with the specified column and value using the NOT_LIKE operator.
      • notLike

        public static Comparison notLike​(Column column,
                                         java.io.Serializable value,
                                         boolean caseSensitive)
        Creates a Comparison object with the specified column and value using the NOT_LIKE operator, and indicates whether the comparison is case-sensitive.
        Returns:
        A Comparison object with the specified column and value using the NOT_LIKE operator, and indicates whether the comparison is case sensitive.