public class Predicates
extends java.lang.Object
search
package may be used by applications as a framework
for building new kinds of Predicate
types. However, it is intended
that most applications will simply use the built-in criterion types via the
static factory methods of this class.
The simple predicates created by the factory methods of this class require a property name. This name always has to start with a lowercase character. For example if the property's getter method in the bean interface is getIDOfTarget() then the property name for the predicate is iDOfTarget.
Constructor and Description |
---|
Predicates() |
Modifier and Type | Method and Description |
---|---|
static Predicate |
and(Predicate p1,
Predicate p2)
Create a predicate which is logical conjunctions of the given predicates.
|
static Predicate |
eq(java.lang.String propertyName,
java.lang.Object value)
Create a "equals" predicate, the beanType is the one given to the search
object.
|
static Predicate |
eq(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "equals" predicate for a given beanType.
|
static Predicate |
ge(java.lang.String propertyName,
java.lang.Object value)
Create a "greater or equals" predicate.
|
static Predicate |
ge(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "greater or equals" predicate for a given beanType.
|
static Predicate |
gt(java.lang.String propertyName,
java.lang.Object value)
Create a "greater then" predicate.
|
static Predicate |
gt(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "greater then" predicate for a given beanType.
|
static Predicate |
le(java.lang.String propertyName,
java.lang.Object value)
Create a "less or equals" predicate.
|
static Predicate |
le(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "less or equals" predicate for a given beanType.
|
static Predicate |
like(java.lang.String propertyName,
java.lang.String value)
Create a "like" predicate.
|
static Predicate |
like(java.lang.String propertyName,
java.lang.String value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "like" predicate for a given beanType.
|
static Predicate |
lt(java.lang.String propertyName,
java.lang.Object value)
Create a "less then" predicate.
|
static Predicate |
lt(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "less then" predicate for a given beanType.
|
static Predicate |
lt(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType,
Search search)
Deprecated.
instead use lt(propertyName, value, beanType)
|
static Predicate |
ne(java.lang.String propertyName,
java.lang.Object value)
Create a "non equal" predicate.
|
static Predicate |
ne(java.lang.String propertyName,
java.lang.Object value,
java.lang.Class<? extends RegistryBean> beanType)
Create a "non equal" predicate for a given beanType.
|
static Predicate |
or(Predicate p1,
Predicate p2)
Create a predicate which is logical disjunctions of the given predicates.
|
public static Predicate like(java.lang.String propertyName, java.lang.String value, java.lang.Class<? extends RegistryBean> beanType)
beanType
- The bean Class
typepropertyName
- the property name, with the first character in lower casevalue
- the comparison valuePredicate
objectpublic static Predicate like(java.lang.String propertyName, java.lang.String value)
propertyName
- the property name, with the first character in lower casevalue
- the comparison valuePredicate
objectpublic static Predicate gt(java.lang.String propertyName, java.lang.Object value)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate gt(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typePredicate
objectpublic static Predicate lt(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType, Search search)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typesearch
- the Search objectPredicate
objectpublic static Predicate lt(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typePredicate
objectpublic static Predicate lt(java.lang.String propertyName, java.lang.Object value)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate ge(java.lang.String propertyName, java.lang.Object value)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate ge(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typePredicate
objectpublic static Predicate le(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typePredicate
objectpublic static Predicate le(java.lang.String propertyName, java.lang.Object value)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate eq(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType) throws CSAppFrameworkException
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuebeanType
- the bean typePredicate
objectCSAppFrameworkException
- If an error occurs while constructing the "equals" predicatepublic static Predicate eq(java.lang.String propertyName, java.lang.Object value) throws CSAppFrameworkException
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectCSAppFrameworkException
- If an error occurs while constructing the "equals" predicatepublic static Predicate ne(java.lang.String propertyName, java.lang.Object value, java.lang.Class<? extends RegistryBean> beanType)
beanType
- The bean Class
typepropertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate ne(java.lang.String propertyName, java.lang.Object value)
propertyName
- the property name, with the first character in lowercasevalue
- the comparison valuePredicate
objectpublic static Predicate and(Predicate p1, Predicate p2)