Class AndFilter<T>
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.utility.filter.CompoundFilter<T>
-
- org.eclipse.persistence.jpa.jpql.tools.utility.filter.AndFilter<T>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Filter<T>
public class AndFilter<T> extends CompoundFilter<T>
This filter will "accept" any object that is accept by both of the specified wrapped filters. The first filter will always be evaluated, while the second will only be evaluated if necessary.- Version:
- 2.4
- See Also:
- Serialized Form
- Since:
- 2.3
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.jpa.jpql.tools.utility.filter.CompoundFilter
filter1, filter2
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(T value)
Determines whether the specified object is "accepted" by the filter.static <T> Filter<T>
and(Filter<T>... filters)
Creates a newANDFilter
that will "accept" any object that is accept by all of the specified filters.AndFilter<T>
clone()
protected java.lang.String
operatorString()
Returns a string representation of the filter's operator.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.utility.filter.CompoundFilter
equals, getFilter1, getFilter2, hashCode, toString
-
-
-
-
Constructor Detail
-
AndFilter
public AndFilter(Filter<T> filter1, Filter<T> filter2)
Creates a newAndFilter
that will "accept" any object that is accept by both of the specified wrapped filters.- Parameters:
filter1
- The firstFilter
that might "accept" any objectfilter2
- The secondFilter
that might "accept" any object
-
-
Method Detail
-
and
public static <T> Filter<T> and(Filter<T>... filters)
Creates a newANDFilter
that will "accept" any object that is accept by all of the specified filters.- Parameters:
filters
- The list offilters
encapsulated by a chain ofAndFilters
- Returns:
- A new chain of
AndFilters
that will "accept" any object when allfilters
accepts the object
-
accept
public boolean accept(T value)
Determines whether the specified object is "accepted" by the filter. The semantics of "accept" is determined by the contract between the client and the server.- Parameters:
value
- The value to filter- Returns:
true
if the given value is "accepted" by this filter;false
if it was "rejected"
-
clone
public AndFilter<T> clone()
- Overrides:
clone
in classCompoundFilter<T>
-
operatorString
protected java.lang.String operatorString()
Returns a string representation of the filter's operator.- Specified by:
operatorString
in classCompoundFilter<T>
- Returns:
- The string value of the operator
-
-