public class CriteriaByDeclaration extends Object
Criteria
trees. In the Java
code this may look as follows (simplified):
import static org.refcodes.criteria.-DeclarativeCriteria.*;
...
Criteria theCriteria = and( or( equalWith( "City", "Berlin" ), equalWith( "City", "Munich" ) ), equalWith( "Surname", "Miller" ) );
...
Modifier and Type | Method and Description |
---|---|
static AndCriteria |
and(Criteria... aChildren)
Creates an AND
CriteriaNode containing the provided
Criteria children. |
static <T> EqualWithCriteria<T> |
equalWith(String aKey,
T aValue)
Creates an EQUAL WITH ("=")
CriteriaLeaf expression relating to
the given key and the given reference value. |
static <T> GreaterOrEqualThanCriteria<T> |
greaterOrEqualThan(String aKey,
T aValue)
Creates an GREATER OR EQUAL THAN (">=")
CriteriaLeaf expression
relating to the given key and the given reference value. |
static <T> GreaterThanCriteria<T> |
greaterThan(String aKey,
T aValue)
Creates an GREATER THAN (">")
CriteriaLeaf expression relating to
the given key and the given reference value. |
static IntersectWithCriteria |
intersectWith(Criteria... aChildren)
Creates an INTERSECT
CriteriaNode containing the provided
Criteria children. |
static <T> LessOrEqualThanCriteria<T> |
lessOrEqualThan(String aKey,
T aValue)
Creates an LESS OR EQUAL THAN ("<=")
CriteriaLeaf expression
relating to the given key and the given reference value. |
static <T> LessThanCriteria<T> |
lessThan(String aKey,
T aValue)
Creates an LESS THAN
CriteriaLeaf expression relating to the
given key and the given reference value. |
static NotCriteria |
not(Criteria aCriteria)
Creates a NOT
CriteriaNode containing the provided
Criteria child. |
static <T> NotEqualWithCriteria<T> |
notEqualWith(String aKey,
T aValue)
Creates a NOT EQUAL WITH ("<>")
CriteriaLeaf expression relating
to the given key and the given reference value. |
static OrCriteria |
or(Criteria... aChildren)
Creates an OR
CriteriaNode containing the provided
Criteria children. |
public static AndCriteria and(Criteria... aChildren)
CriteriaNode
containing the provided
Criteria
children.aChildren
- The Criteria
children to be contained in the AND
CriteriaNode
.CriteriaNode
.public static <T> EqualWithCriteria<T> equalWith(String aKey, T aValue)
CriteriaLeaf
expression relating to
the given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.public static <T> GreaterOrEqualThanCriteria<T> greaterOrEqualThan(String aKey, T aValue)
CriteriaLeaf
expression
relating to the given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.public static <T> GreaterThanCriteria<T> greaterThan(String aKey, T aValue)
CriteriaLeaf
expression relating to
the given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.public static IntersectWithCriteria intersectWith(Criteria... aChildren)
CriteriaNode
containing the provided
Criteria
children.aChildren
- The Criteria
children to be contained in the
INTERSECT CriteriaNode
.CriteriaNode
.public static <T> LessOrEqualThanCriteria<T> lessOrEqualThan(String aKey, T aValue)
CriteriaLeaf
expression
relating to the given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.public static <T> LessThanCriteria<T> lessThan(String aKey, T aValue)
CriteriaLeaf
expression relating to the
given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.public static NotCriteria not(Criteria aCriteria)
CriteriaNode
containing the provided
Criteria
child.aCriteria
- The Criteria
child to be contained in the NOT
CriteriaNode
.CriteriaNode
.public static OrCriteria or(Criteria... aChildren)
CriteriaNode
containing the provided
Criteria
children.aChildren
- The Criteria
children to be contained in the OR
CriteriaNode
.CriteriaNode
.public static <T> NotEqualWithCriteria<T> notEqualWith(String aKey, T aValue)
CriteriaLeaf
expression relating
to the given key and the given reference value.T
- The type of the CriteriaLeaf
's value.aKey
- The key on which the reference value is to be applied.aValue
- The reference value to be applied on the key.CriteriaLeaf
.Copyright © 2015. All rights reserved.