Class Comparison

java.lang.Object
com.sas.lsaf.query.Comparison
All Implemented Interfaces:
Constraint, Serializable

public class Comparison extends 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:
  • Constructor Details

    • Comparison

      public Comparison(Column column, Comparison.Operator operator, 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, 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 Details

    • 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 Serializable getValue()
      Gets the value to compare.
      Returns:
      The value to compare.
    • setValue

      public void setValue(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.
    • operator

      public Comparison operator(Comparison.Operator o)
      Sets the Comparison.Operator of the comparison.
      Returns:
      The updated Comparison object.
    • value

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

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

      public static Comparison comparison(Column column, Comparison.Operator operator, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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.