Package org.fryske_akademy.jpa
Enum Class OPERATOR
- All Implemented Interfaces:
Serializable,Comparable<OPERATOR>,Constable
A series of operators supported by this library, encapsulates all
intelligence around them. Some of the operators may be determined from user
input, for these
getUserInput() } has a value.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionNot an operator, it is here to support " AND " syntax in user valuescase-insensitive user inputfor empty collection! case-insensitive user inputcase-insensitive user inputfor empty collection! case-insensitive user inputcase-insensitive user inputcase-insensitive user inputNot an operator, it is here to support " OR " syntax in user values -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheck if a string (user value) indicates a greater/smaller than or equal comparisonstatic OPERATORstatic OPERATORfromUserInput(String input) getToken()When null the OPERATOR cannot be determined from user inputstatic booleancheck if a string (user value) indicates a greater than comparisonstatic booleantrue when " AND " is found in the given string and it comes before an optional " OR " and there are at least two termsstatic booleanbooleanisOperatorInUserInput(String input) Is this operator in user inputstatic booleantrue when " OR " is found in the given string and it comes before an optional " AND " and there are at least two termsstatic booleancheck if a string (user value) indicates a negationstatic OPERATORReturns an operator from the value when syntaxInValue is true and the value contains one of the supported operators, otherwise the operator is determined from the operator argumentstatic booleanoperatorInUserInput(String input) Does user input contain an operatorstatic booleancheck if a string (user value) indicates a smaller than comparison.static StringstripSyntax(String value) Strip !, <, >, = at the beginning of a value in order to get the raw user supplied value.toString()returns the token wrapped in spaces, so string concatenation in query building can be used.static booleanvalueIsOperator(String s, boolean syntaxInValue) users may input "(!)is null", "(!)is empty", "(!)is blank", in that case there is no parameter value to be set for a key.static OPERATORReturns the enum constant of this class with the specified name.static OPERATOR[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
EQ
-
GT
-
LT
-
GE
-
LE
-
IN
-
LIKE
-
NE
-
MEMBEROF
-
BETWEEN
-
ISNULL
case-insensitive user input -
ISNOTNULL
case-insensitive user input -
ISBLANK
case-insensitive user input -
ISNOTBLANK
case-insensitive user input -
ISEMPTY
for empty collection! case-insensitive user input -
ISNOTEMPTY
for empty collection! case-insensitive user input -
AND
Not an operator, it is here to support " AND " syntax in user values -
OR
Not an operator, it is here to support " OR " syntax in user values
-
-
Field Details
-
NEGATION
public static final char NEGATION- See Also:
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
negation
check if a string (user value) indicates a negation- Parameters:
value-- Returns:
- See Also:
-
stripSyntax
Strip !, <, >, = at the beginning of a value in order to get the raw user supplied value.- Parameters:
value-- Returns:
-
eq
check if a string (user value) indicates a greater/smaller than or equal comparison -
greater
check if a string (user value) indicates a greater than comparison- Parameters:
value-- Returns:
- See Also:
-
smaller
check if a string (user value) indicates a smaller than comparison.- Parameters:
value-- Returns:
- See Also:
-
valueIsOperator
users may input "(!)is null", "(!)is empty", "(!)is blank", in that case there is no parameter value to be set for a key.- Parameters:
s-syntaxInValue-- Returns:
-
isBetween
-
isAnd
true when " AND " is found in the given string and it comes before an optional " OR " and there are at least two terms- Parameters:
value-- Returns:
-
isOr
true when " OR " is found in the given string and it comes before an optional " AND " and there are at least two terms- Parameters:
value-- Returns:
-
operator
Returns an operator from the value when syntaxInValue is true and the value contains one of the supported operators, otherwise the operator is determined from the operator argument- Parameters:
operator-value-syntaxInValue-- Returns:
-
toString
returns the token wrapped in spaces, so string concatenation in query building can be used. -
getToken
-
getUserInput
When null the OPERATOR cannot be determined from user input- Returns:
-
isOperatorInUserInput
Is this operator in user input- Parameters:
input-- Returns:
-
fromToken
-
fromUserInput
-
operatorInUserInput
Does user input contain an operator- Parameters:
input-- Returns:
- See Also:
-