Package org.refcodes.criteria
Class CriteriaSugar
- java.lang.Object
-
- org.refcodes.criteria.CriteriaSugar
-
public class CriteriaSugar extends java.lang.ObjectDeclarative syntactic sugar which may be statically imported in order to allow declarative definitions ofCriteriatrees: ... Criteria theCriteria = and( or( equalWith( "City", "Berlin" ), equalWith( "City", "Munich" ) ), equalWith( "Surname", "Miller" ) ); ...- Version:
- $Id: $Id
- Author:
- steiner
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AndCriteriaand(Criteria... aChildren)Creates an ANDCriteriaNodecontaining the providedCriteriachildren.static <T> EqualWithCriteria<T>equalWith(java.lang.String aKey, T aValue)Creates an EQUAL WITH ("=")CriteriaLeafexpression relating to the given key and the given reference value.static <T> GreaterOrEqualThanCriteria<T>greaterOrEqualThan(java.lang.String aKey, T aValue)Creates an GREATER OR EQUAL THAN (">=")CriteriaLeafexpression relating to the given key and the given reference value.static <T> GreaterThanCriteria<T>greaterThan(java.lang.String aKey, T aValue)Creates an GREATER THAN (">")CriteriaLeafexpression relating to the given key and the given reference value.static IntersectWithCriteriaintersectWith(Criteria... aChildren)Creates an INTERSECTCriteriaNodecontaining the providedCriteriachildren.static <T> LessOrEqualThanCriteria<T>lessOrEqualThan(java.lang.String aKey, T aValue)Creates an LESS OR EQUAL THAN ("<=")CriteriaLeafexpression relating to the given key and the given reference value.static <T> LessThanCriteria<T>lessThan(java.lang.String aKey, T aValue)Creates an LESS THANCriteriaLeafexpression relating to the given key and the given reference value.static NotCriterianot(Criteria aCriteria)Creates a NOTCriteriaNodecontaining the providedCriteriachild.static <T> NotEqualWithCriteria<T>notEqualWith(java.lang.String aKey, T aValue)Creates a NOT EQUAL WITH ("<>")CriteriaLeafexpression relating to the given key and the given reference value.static OrCriteriaor(Criteria... aChildren)Creates an ORCriteriaNodecontaining the providedCriteriachildren.
-
-
-
Method Detail
-
and
public static AndCriteria and(Criteria... aChildren)
Creates an ANDCriteriaNodecontaining the providedCriteriachildren.- Parameters:
aChildren- TheCriteriachildren to be contained in the ANDCriteriaNode.- Returns:
- The AND
CriteriaNode.
-
equalWith
public static <T> EqualWithCriteria<T> equalWith(java.lang.String aKey, T aValue)
Creates an EQUAL WITH ("=")CriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The EQUAL WITH
CriteriaLeaf.
-
greaterOrEqualThan
public static <T> GreaterOrEqualThanCriteria<T> greaterOrEqualThan(java.lang.String aKey, T aValue)
Creates an GREATER OR EQUAL THAN (">=")CriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The GREATER OR EQUAL THAN
CriteriaLeaf.
-
greaterThan
public static <T> GreaterThanCriteria<T> greaterThan(java.lang.String aKey, T aValue)
Creates an GREATER THAN (">")CriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The GREATER THAN
CriteriaLeaf.
-
intersectWith
public static IntersectWithCriteria intersectWith(Criteria... aChildren)
Creates an INTERSECTCriteriaNodecontaining the providedCriteriachildren.- Parameters:
aChildren- TheCriteriachildren to be contained in the INTERSECTCriteriaNode.- Returns:
- The INTERSECT
CriteriaNode.
-
lessOrEqualThan
public static <T> LessOrEqualThanCriteria<T> lessOrEqualThan(java.lang.String aKey, T aValue)
Creates an LESS OR EQUAL THAN ("<=")CriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The LESS OR EQUAL THAN
CriteriaLeaf.
-
lessThan
public static <T> LessThanCriteria<T> lessThan(java.lang.String aKey, T aValue)
Creates an LESS THANCriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The LESS THAN
CriteriaLeaf.
-
not
public static NotCriteria not(Criteria aCriteria)
Creates a NOTCriteriaNodecontaining the providedCriteriachild.- Parameters:
aCriteria- TheCriteriachild to be contained in the NOTCriteriaNode.- Returns:
- The NOT
CriteriaNode.
-
or
public static OrCriteria or(Criteria... aChildren)
Creates an ORCriteriaNodecontaining the providedCriteriachildren.- Parameters:
aChildren- TheCriteriachildren to be contained in the ORCriteriaNode.- Returns:
- The OR
CriteriaNode.
-
notEqualWith
public static <T> NotEqualWithCriteria<T> notEqualWith(java.lang.String aKey, T aValue)
Creates a NOT EQUAL WITH ("<>")CriteriaLeafexpression relating to the given key and the given reference value.- Type Parameters:
T- The type of theCriteriaLeaf's value.- Parameters:
aKey- The key on which the reference value is to be applied.aValue- The reference value to be applied on the key.- Returns:
- The NOT EQUAL WITH
CriteriaLeaf.
-
-