public static enum Property.Operator extends Enum<Property.Operator>
Enum Constant and Description |
---|
DELEGATE
No operator, use the operator from the other property when
comparing.
|
EQUAL
Use the
.equals() method. |
GEQUAL
Use
.compareTo() and match if target is greater than
or equal to supplied operand. |
GREATER
Use
.compareTo() amd match if target is greater than
supplied operand. |
LEQUAL
Use
.compareTo() amd match if target is less than or
equal to the supplied operand. |
LESS
Use
.compareTo() amd match if target is less than the
supplied operand. |
NOTEQUAL
Use the
.equals() method but match if the result is
false. |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
apply(Property<?,?> operand1,
Property<?,?> operand2)
Stub for subclasses to implement their logic.
|
boolean |
compare(Property<?,?> operand1,
Property<?,?> operand2)
Compare the two operands by applying this operator infix
with respect to them.
|
static Property.Operator |
defaultOperator()
Gets the default operator to use if none is specified.
|
static Property.Operator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Property.Operator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Property.Operator DELEGATE
public static final Property.Operator EQUAL
.equals()
method.public static final Property.Operator NOTEQUAL
.equals()
method but match if the result is
false.public static final Property.Operator GREATER
.compareTo()
amd match if target is greater than
supplied operand.public static final Property.Operator GEQUAL
.compareTo()
and match if target is greater than
or equal to supplied operand.public static final Property.Operator LESS
.compareTo()
amd match if target is less than the
supplied operand.public static final Property.Operator LEQUAL
.compareTo()
amd match if target is less than or
equal to the supplied operand.public static Property.Operator[] values()
for (Property.Operator c : Property.Operator.values()) System.out.println(c);
public static Property.Operator valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final boolean compare(@Nullable Property<?,?> operand1, @Nullable Property<?,?> operand2)
Compare the two operands by applying this operator infix
with respect to them. For example, if this object is
GREATER
then calling this method with
object1
and object2
would effectively
return:
returnValue = object1 > object2;
operand1
- First operandoperand2
- Second operandprotected abstract boolean apply(Property<?,?> operand1, Property<?,?> operand2)
operand1
- First operandoperand2
- Second operandpublic static Property.Operator defaultOperator()