|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.criterion.Criterion<UJO>
public abstract class Criterion<UJO extends Ujo>
An abstract criterion provides a basic interface and static factory methods. You can use it:
// Make a criterion: Criterion<Person> crn1 = Criterion.newInstance(CASH, Operator.GT, 10.0); Criterion<Person> crn2 = Criterion.newInstance(CASH, Operator.LE, 20.0); Criterion<Person> criterion = crn1.and(crn2); // Use a criterion (1): CriteriaTool<Person> ct = CriteriaTool.newInstance(); List<Person> result = ct.select(persons, criterion); assertEquals(1, result.size()); assertEquals(20.0, CASH.of(result.get(0))); // Use a criterion (2): Person person = result.get(0); boolean validation = criterion.evaluate(person); assertTrue(validation);
| Constructor Summary | |
|---|---|
Criterion()
|
|
| Method Summary | ||
|---|---|---|
Criterion<UJO> |
and(Criterion<UJO> criterion)
|
|
abstract boolean |
evaluate(UJO ujo)
|
|
abstract java.lang.Object |
getLeftNode()
Returns the left node of the parrent |
|
abstract AbstractOperator |
getOperator()
Returns an operator |
|
abstract java.lang.Object |
getRightNode()
Returns the right node of the parrent |
|
boolean |
isBinary()
Is a Binary criterion? |
|
Criterion<UJO> |
join(BinaryOperator operator,
Criterion<UJO> criterion)
|
|
static
|
newInstance(boolean value)
This is an constane criterion independed on an entity. |
|
static
|
newInstance(UjoProperty<UJO,TYPE> property)
New equals instance |
|
static
|
newInstance(UjoProperty<UJO,TYPE> property,
Operator operator,
TYPE value)
New criterion instance |
|
static
|
newInstance(UjoProperty<UJO,TYPE> property,
Operator operator,
UjoProperty<?,TYPE> value)
New criterion instance |
|
static
|
newInstance(UjoProperty<UJO,TYPE> property,
TYPE value)
New equals instance |
|
static
|
newInstance(UjoProperty<UJO,TYPE> property,
UjoProperty<?,TYPE> value)
New equals instance |
|
static
|
newInstanceFalse(UjoProperty<UJO,?> property)
This is a constant criterion independed on the property and the ujo entity. |
|
static
|
newInstanceTrue(UjoProperty<UJO,?> property)
This is a constant criterion independed on the property and the ujo entity. |
|
Criterion<UJO> |
not()
|
|
Criterion<UJO> |
or(Criterion<UJO> criterion)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Criterion()
| Method Detail |
|---|
public abstract boolean evaluate(UJO ujo)
public Criterion<UJO> join(BinaryOperator operator,
Criterion<UJO> criterion)
public Criterion<UJO> and(Criterion<UJO> criterion)
public Criterion<UJO> or(Criterion<UJO> criterion)
public Criterion<UJO> not()
public abstract java.lang.Object getLeftNode()
public abstract java.lang.Object getRightNode()
public abstract AbstractOperator getOperator()
public static <UJO extends Ujo,TYPE> Criterion<UJO> newInstance(UjoProperty<UJO,TYPE> property,
Operator operator,
TYPE value)
property - UjoPropertyoperator - Operator
public static <UJO extends Ujo,TYPE> Criterion<UJO> newInstance(UjoProperty<UJO,TYPE> property,
Operator operator,
UjoProperty<?,TYPE> value)
property - UjoPropertyoperator - Operator
public static <UJO extends Ujo,TYPE> Criterion<UJO> newInstance(UjoProperty<UJO,TYPE> property,
TYPE value)
property - UjoProperty
public static <UJO extends Ujo,TYPE> Criterion<UJO> newInstance(UjoProperty<UJO,TYPE> property,
UjoProperty<?,TYPE> value)
property - UjoPropertyvalue - Value or UjoProperty can be type of
public static <UJO extends Ujo,TYPE> Criterion<UJO> newInstance(UjoProperty<UJO,TYPE> property)
property - UjoProperty
public static <UJO extends Ujo> Criterion<UJO> newInstance(boolean value)
public static <UJO extends Ujo> Criterion<UJO> newInstanceTrue(UjoProperty<UJO,?> property)
public static <UJO extends Ujo> Criterion<UJO> newInstanceFalse(UjoProperty<UJO,?> property)
public boolean isBinary()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||