F
- The type of the field specification.public class QueryFilter<F> extends Object
Modifier and Type | Field and Description |
---|---|
protected org.forgerock.util.query.QueryFilter.Impl<F> |
pimpl
the filter implementation.
|
Modifier | Constructor and Description |
---|---|
protected |
QueryFilter(org.forgerock.util.query.QueryFilter.Impl<F> pimpl)
Construct a QueryFilter from a base filter implementation.
|
protected |
QueryFilter(org.forgerock.util.query.QueryFilter.Impl<F> pimpl,
QueryFilterVisitor<StringBuilder,StringBuilder,F> toStringVisitor)
Construct a QueryFilter from a base filter implementation and a custom toString implementation.
|
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(QueryFilterVisitor<R,P,F> v,
P p)
Applies a
QueryFilterVisitor to this QueryFilter . |
static <FF> QueryFilter<FF> |
alwaysFalse()
Returns a filter which does not match any resources.
|
static <FF> QueryFilter<FF> |
alwaysTrue()
Returns a filter which matches all resources.
|
static <FF> QueryFilter<FF> |
and(Collection<QueryFilter<FF>> subFilters)
Creates a new
and filter using the provided list of sub-filters. |
static <FF> QueryFilter<FF> |
and(QueryFilter<FF>... subFilters)
Creates a new
and filter using the provided list of sub-filters. |
static <FF> QueryFilter<FF> |
comparisonFilter(FF field,
String operator,
Object valueAssertion)
Creates a new generic comparison filter using the provided field name,
operator, and value assertion.
|
static <FF> QueryFilter<FF> |
contains(FF field,
Object valueAssertion)
Creates a new
contains filter using the provided field name and
value assertion. |
boolean |
equals(Object obj) |
static <FF> QueryFilter<FF> |
equalTo(FF field,
Object valueAssertion)
Creates a new
equality filter using the provided field name and
value assertion. |
static <FF> QueryFilter<FF> |
extendedMatch(FF field,
String operator,
Object valueAssertion)
Creates a new
extended match filter using the provided
field name, operator and value assertion. |
static <FF> QueryFilter<FF> |
greaterThan(FF field,
Object valueAssertion)
Creates a new
greater than filter using the provided field name
and value assertion. |
static <FF> QueryFilter<FF> |
greaterThanOrEqualTo(FF field,
Object valueAssertion)
Creates a new
greater than or equal to filter using the provided
field name and value assertion. |
int |
hashCode() |
static <FF> QueryFilter<FF> |
lessThan(FF field,
Object valueAssertion)
Creates a new
less than filter using the provided field name and
value assertion. |
static <FF> QueryFilter<FF> |
lessThanOrEqualTo(FF field,
Object valueAssertion)
Creates a new
less than or equal to filter using the provided
field name and value assertion. |
static <FF> QueryFilter<FF> |
not(QueryFilter<FF> subFilter)
Creates a new
not filter using the provided sub-filter. |
static <FF> QueryFilter<FF> |
or(Collection<QueryFilter<FF>> subFilters)
Creates a new
or filter using the provided list of sub-filters. |
static <FF> QueryFilter<FF> |
or(QueryFilter<FF>... subFilters)
Creates a new
or filter using the provided list of sub-filters. |
static <FF> QueryFilter<FF> |
present(FF field)
Creates a new
presence filter using the provided field name. |
static <FF> QueryFilter<FF> |
startsWith(FF field,
Object valueAssertion)
Creates a new
starts with filter using the provided field name
and value assertion. |
String |
toString()
Returns the string representation of this query filter.
|
protected QueryFilter(org.forgerock.util.query.QueryFilter.Impl<F> pimpl)
pimpl
- the filter implementation.protected QueryFilter(org.forgerock.util.query.QueryFilter.Impl<F> pimpl, QueryFilterVisitor<StringBuilder,StringBuilder,F> toStringVisitor)
pimpl
- the filter implemntation.toStringVisitor
- the visitor to provide a toString implementation.public static <FF> QueryFilter<FF> alwaysFalse()
FF
- The type of the field specification. Named to be distinct from the type of the parent class.public static <FF> QueryFilter<FF> alwaysTrue()
FF
- The type of the field specification. Named to be distinct from the type of the parent class.public static <FF> QueryFilter<FF> and(Collection<QueryFilter<FF>> subFilters)
and
filter using the provided list of sub-filters.
Creating a new and
filter with a null
or empty list of
sub-filters is equivalent to calling alwaysTrue()
.
FF
- The type of the field specification. Named to be distinct from the type of the parent class.subFilters
- The list of sub-filters, may be empty or null
.and
filter.@SafeVarargs public static <FF> QueryFilter<FF> and(QueryFilter<FF>... subFilters)
and
filter using the provided list of sub-filters.
Creating a new and
filter with a null
or empty list of
sub-filters is equivalent to calling alwaysTrue()
.
FF
- The type of the field specification. Named to be distinct from the type of the parent class.subFilters
- The list of sub-filters, may be empty or null
.and
filter.public static <FF> QueryFilter<FF> comparisonFilter(FF field, String operator, Object valueAssertion)
equalTo(Object, Object)
.
Otherwise, when the operator name does not correspond to a core operator,
an extended comparison filter will be returned.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field within the JSON resource to be compared.operator
- The operator to use for the comparison, which must be one of
the core operator names, or a string matching the regular
expression [a-zA-Z_0-9.]+
.valueAssertion
- The assertion value.IllegalArgumentException
- If operator
is not a valid operator name.public static <FF> QueryFilter<FF> contains(FF field, Object valueAssertion)
contains
filter using the provided field name and
value assertion. This method is used to check that the string representation
of the field contains the provided substring. When operating on a collection
of values the operation should be evaluated on each element in the collection,
passing if any of the element's string representations contain the provided
substring.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.contains
filter.public static <FF> QueryFilter<FF> equalTo(FF field, Object valueAssertion)
equality
filter using the provided field name and
value assertion. This would represent either equality for single values, or
contains and equal value for a collection of values.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.equality
filter.public static <FF> QueryFilter<FF> greaterThan(FF field, Object valueAssertion)
greater than
filter using the provided field name
and value assertion. This method is used to check that the value of the field
is greater than the provided value. When operating on a collection of values
the operation should be evaluated on each element in the collection, passing
if any of the element's values are greater than the provided value.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.greater than
filter.public static <FF> QueryFilter<FF> greaterThanOrEqualTo(FF field, Object valueAssertion)
greater than or equal to
filter using the provided
field name and value assertion. This method is used to check that the value
of the field is greater than or equal to the provided value. When operating
on a collection of values the operation should be evaluated on each element
in the collection, passing if any of the element's values are greater than
or equal to the provided value.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.greater than or equal to
filter.public static <FF> QueryFilter<FF> lessThan(FF field, Object valueAssertion)
less than
filter using the provided field name and
value assertion. This method is used to check that the value of the field
is less than the provided value. When operating on a collection of values
the operation should be evaluated on each element in the collection, passing
if any of the element's values are less than the provided value.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.less than
filter.public static <FF> QueryFilter<FF> extendedMatch(FF field, String operator, Object valueAssertion)
extended match
filter using the provided
field name, operator and value assertion.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.operator
- The operator.valueAssertion
- The assertion value.less than or equal to
filter.public static <FF> QueryFilter<FF> lessThanOrEqualTo(FF field, Object valueAssertion)
less than or equal to
filter using the provided
field name and value assertion. This method is used to check that the value
of the field is less than or equal to the provided value. When operating
on a collection of values the operation should be evaluated on each element
in the collection, passing if any of the element's values are less than
or equal to the provided value.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.less than or equal to
filter.public static <FF> QueryFilter<FF> not(QueryFilter<FF> subFilter)
not
filter using the provided sub-filter.FF
- The type of the field specification. Named to be distinct from the type of the parent class.subFilter
- The sub-filter.not
filter.public static <FF> QueryFilter<FF> or(Collection<QueryFilter<FF>> subFilters)
or
filter using the provided list of sub-filters.
Creating a new or
filter with a null
or empty list of
sub-filters is equivalent to calling alwaysFalse()
.
FF
- The type of the field specification. Named to be distinct from the type of the parent class.subFilters
- The list of sub-filters, may be empty or null
.or
filter.@SafeVarargs public static <FF> QueryFilter<FF> or(QueryFilter<FF>... subFilters)
or
filter using the provided list of sub-filters.
Creating a new or
filter with a null
or empty list of
sub-filters is equivalent to calling alwaysFalse()
.
FF
- The type of the field specification. Named to be distinct from the type of the parent class.subFilters
- The list of sub-filters, may be empty or null
.or
filter.public static <FF> QueryFilter<FF> present(FF field)
presence
filter using the provided field name.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field which must be
present.presence
filter.public static <FF> QueryFilter<FF> startsWith(FF field, Object valueAssertion)
starts with
filter using the provided field name
and value assertion. This method is used to check that the string representation
of the field starts with the provided substring. When operating on a collection
of values the operation should be evaluated on each element in the collection,
passing if any of the element's string representations starts with the provided
substring.FF
- The type of the field specification. Named to be distinct from the type of the parent class.field
- The name of field to be compared.valueAssertion
- The assertion value.starts with
filter.public <R,P> R accept(QueryFilterVisitor<R,P,F> v, P p)
QueryFilterVisitor
to this QueryFilter
.R
- The return type of the visitor's methods.P
- The type of the additional parameters to the visitor's
methods.v
- The filter visitor.p
- Optional additional visitor parameter.public String toString()
(true)
(! /role eq "user")
Copyright 2011-2015 ForgeRock AS.