Package com.sas.lsaf.query
Class Comparison
java.lang.Object
com.sas.lsaf.query.Comparison
- All Implemented Interfaces:
Constraint,Serializable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe method with which to evaluate data that is compared to a value. -
Constructor Summary
ConstructorsConstructorDescriptionComparison(Column column, Comparison.Operator operator, Serializable value) Constructor.Comparison(Column column, Comparison.Operator operator, Serializable value, boolean caseSensitive) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionSets the comparison as case insensitive.Sets the comparison as case-sensitive.Sets theColumnof the comparison.static Comparisoncomparison(Column column, Comparison.Operator operator, Serializable value) Creates aComparisonobject with the specified column, operator, and value.static Comparisoncomparison(Column column, Comparison.Operator operator, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column, operator, value and indicates whether the comparison is case-sensitive.static Comparisonequal(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theEQUALoperator.static Comparisonequal(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theEQUALoperator, and indicates whether the comparison is case-sensitive.Gets the column for the comparison.Gets the operator for the comparison.getValue()Gets the value to compare.static ComparisongreaterThan(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theGREATER_THANoperator.static ComparisongreaterThan(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theGREATER_THANoperator, and indicates whether the comparison is case-sensitive.static ComparisongreaterThanOrEqual(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator.static ComparisongreaterThanOrEqual(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator, and indicates whether the comparison should be case-sensitive.booleanIndicates whether the comparison is case-sensitive.static ComparisonlessThan(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theLESS_THANoperator.static ComparisonlessThan(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theLESS_THANoperator, and indicates whether the comparison is case-sensitive.static ComparisonlessThanOrEqual(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator.static ComparisonlessThanOrEqual(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator, and indicates whether the comparison is case-sensitive.static Comparisonlike(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theLIKEoperator.static Comparisonlike(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theLIKEoperator, and indicates whether the comparison is case-sensitive.static ComparisonnotEqual(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theNOT_EQUALoperator.static ComparisonnotEqual(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theNOT_EQUALoperator, and indicates whether the comparison is case-sensitive.static ComparisonnotLike(Column column, Serializable value) Creates aComparisonobject with the specified column and value using theNOT_LIKEoperator.static ComparisonnotLike(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theNOT_LIKEoperator, and indicates whether the comparison is case-sensitive.Sets theComparison.Operatorof the comparison.voidsetCaseSensitive(boolean caseSensitive) Sets whether the comparison is case-sensitive.voidSets the column for the comparison.voidsetOperator(Comparison.Operator operator) Sets the operator for the comparison.voidsetValue(Serializable value) Sets the value for comparison.toString()Sets the value of the comparison.
-
Constructor Details
-
Comparison
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 isTrue.
-
-
Method Details
-
getColumn
Gets the column for the comparison.- Returns:
- The column for the comparison.
-
setColumn
Sets the column for the comparison.- Parameters:
column- The column for the comparison.
-
getOperator
Gets the operator for the comparison.- Returns:
- The operator for the comparison.
-
setOperator
Sets the operator for the comparison.- Parameters:
operator- The operator for the comparison.
-
getValue
Gets the value to compare.- Returns:
- The value to compare.
-
setValue
Sets the value for comparison.- Parameters:
value- The value for comparison.
-
isCaseSensitive
public boolean isCaseSensitive()Indicates whether the comparison is case-sensitive.- Returns:
- A
booleanvalue that indicates whether the comparison is case-sensitive.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Sets whether the comparison is case-sensitive. Default isTrue.- Parameters:
caseSensitive- Indicator of whether the comparison is case-sensitive. Default isTrue.
-
caseSensitive
Sets the comparison as case-sensitive. If not explicitly set, the default comparison is case-sensitive.- Returns:
- The updated Comparison object.
-
caseInsensitive
Sets the comparison as case insensitive. If not explicitly set, the default comparison is case-sensitive.- Returns:
- The updated Comparison object.
-
column
Sets theColumnof the comparison.- Returns:
- The updated Comparison object.
-
operator
Sets theComparison.Operatorof the comparison.- Returns:
- The updated Comparison object.
-
value
Sets the value of the comparison.- Returns:
- The updated Comparison object.
-
toString
-
comparison
public static Comparison comparison(Column column, Comparison.Operator operator, Serializable value) Creates aComparisonobject with the specified column, operator, and value.- Returns:
- A
Comparisonobject with the specified column, operator, and value.
-
comparison
public static Comparison comparison(Column column, Comparison.Operator operator, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column, operator, value and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column, operator, value and indicates whether the comparison is case-sensitive.
-
equal
Creates aComparisonobject with the specified column and value using theEQUALoperator.- Returns:
- A
Comparisonobject with the specified column and value using theEQUALoperator.
-
equal
Creates aComparisonobject with the specified column and value using theEQUALoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theEQUALoperator, and indicates whether the comparison is case-sensitive.
-
notEqual
Creates aComparisonobject with the specified column and value using theNOT_EQUALoperator.- Returns:
- A
Comparisonobject with the specified column and value using theNOT_EQUALoperator.
-
notEqual
Creates aComparisonobject with the specified column and value using theNOT_EQUALoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theNOT_EQUALoperator, and indicates whether the comparison is case sensitive.
-
greaterThan
Creates aComparisonobject with the specified column and value using theGREATER_THANoperator.- Returns:
- A
Comparisonobject with the specified column and value using theGREATER_THANoperator.
-
greaterThan
Creates aComparisonobject with the specified column and value using theGREATER_THANoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theGREATER_THANoperator, and indicates whether the comparison is case sensitive.
-
greaterThanOrEqual
Creates aComparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator.- Returns:
- A
Comparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator.
-
greaterThanOrEqual
public static Comparison greaterThanOrEqual(Column column, Serializable value, boolean caseSensitive) Creates aComparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator, and indicates whether the comparison should be case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theGREATER_THAN_OR_EQUALoperator, and indicates whether the comparison is case-sensitive.
-
lessThan
Creates aComparisonobject with the specified column and value using theLESS_THANoperator.- Returns:
- A
Comparisonobject with the specified column and value using theLESS_THANoperator.
-
lessThan
Creates aComparisonobject with the specified column and value using theLESS_THANoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theLESS_THANoperator, and indicates whether the comparison is case-sensitive.
-
lessThanOrEqual
Creates aComparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator.- Returns:
- A
Comparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator.
-
lessThanOrEqual
Creates aComparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theLESS_THAN_OR_EQUALoperator, and indicates whether the comparison should be case-sensitive.
-
like
Creates aComparisonobject with the specified column and value using theLIKEoperator.- Returns:
- A
Comparisonobject with the specified column and value using theLIKEoperator.
-
like
Creates aComparisonobject with the specified column and value using theLIKEoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theLIKEoperator, and indicates whether the comparison is case-sensitive.
-
notLike
Creates aComparisonobject with the specified column and value using theNOT_LIKEoperator.- Returns:
- A
Comparisonobject with the specified column and value using theNOT_LIKEoperator.
-
notLike
Creates aComparisonobject with the specified column and value using theNOT_LIKEoperator, and indicates whether the comparison is case-sensitive.- Returns:
- A
Comparisonobject with the specified column and value using theNOT_LIKEoperator, and indicates whether the comparison is case sensitive.
-