Package com.appiancorp.common.query
Class Filter<T>
java.lang.Object
com.appiancorp.common.query.Filter<T>
- Type Parameters:
T
- Type of value
- All Implemented Interfaces:
Criteria
,com.appiancorp.common.query.ReadOnlyFilter
,Serializable
- Direct Known Subclasses:
GenericFilter
,TypedValueFilter
@GwtCompatible
@MappedSuperclass
public abstract class Filter<T>
extends Object
implements com.appiancorp.common.query.ReadOnlyFilter
Bean representing a configured Filter on a column.
The column can be filtered either by a value or an expression, which evaluated value will be use to filter.
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Filter()
Initializes a newly createdFilter
protected
Filter
(String field, FilterOperator operator, String valueExpression) Constructs a newFilter
where its constraint is given as an expression.protected
Filter
(String field, FilterOperator operator, T value) Constructs a newFilter
where its constraint is given as an object value. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> boolean
containsFilters
(Criteria criteria, Iterable<Filter<T>> filters) Checks if all thefilters
are contained by the givencriteria
boolean
getField()
Returns the column or alias nameReturns theFilterOperator
abstract T
getValue()
Returns the value used as a constraint on the column or aliasReturn the value expression used as a constraint on the column or aliascom.appiancorp.core.expr.portable.PortableTypedValue
int
hashCode()
static final com.appiancorp.common.query.Filter.IsPartOfCriteriaPredicate
Returns aFunction
which retrieves the column/alias/field name from a givenFilter
protected abstract void
toString()
-
Field Details
-
XML_ROOT_ELEMENT
- See Also:
-
TABLE_NAME
- See Also:
-
LOCAL_PART
- See Also:
-
QNAME
-
-
Constructor Details
-
Filter
protected Filter()Initializes a newly createdFilter
-
Filter
Constructs a newFilter
where its constraint is given as an expression.The constructor that takes
T value
is preferred over this constructor because evaluation of an expression to obtain the value is unnecessary except in cases of deferred evaluation, which are not applicable to cases of constructing a Filter for plug-ins.- Parameters:
field
- column or alias nameoperator
- filter type define asFilterOperator
valueExpression
- expression representing the object use to constraint the column or alias- See Also:
-
Filter
Constructs a newFilter
where its constraint is given as an object value.- Parameters:
field
- column or alias nameoperator
- filter type define asFilterOperator
value
- object use to constraint the column or alias
-
-
Method Details
-
getValue
Returns the value used as a constraint on the column or alias- Returns:
- the value constraint
-
setValue
-
getValueReadOnly
public com.appiancorp.core.expr.portable.PortableTypedValue getValueReadOnly()- Specified by:
getValueReadOnly
in interfacecom.appiancorp.common.query.ReadOnlyFilter
-
getField
Returns the column or alias name- Specified by:
getField
in interfacecom.appiancorp.common.query.ReadOnlyFilter
- Returns:
- the column or alias name
-
getOperator
Returns theFilterOperator
- Specified by:
getOperator
in interfacecom.appiancorp.common.query.ReadOnlyFilter
- Returns:
- the
FilterOperator
-
getValueExpression
Return the value expression used as a constraint on the column or alias- Specified by:
getValueExpression
in interfacecom.appiancorp.common.query.ReadOnlyFilter
- Returns:
- the object use to constraint the column or alias
-
toString
-
hashCode
public int hashCode() -
equals
-
isPartOfCriteriaPredicate
public static final com.appiancorp.common.query.Filter.IsPartOfCriteriaPredicate isPartOfCriteriaPredicate(Criteria c) -
containsFilters
Checks if all thefilters
are contained by the givencriteria
-
selectField
Returns aFunction
which retrieves the column/alias/field name from a givenFilter
- Returns:
- a
Function
which retrieves the column/alias/field name from a givenFilter
-