Package org.forgerock.json.resource
Class Filters
java.lang.Object
org.forgerock.json.resource.Filters
This class contains methods for creating various kinds of
Filter
and
FilterCondition
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic FilterCondition
and
(Collection<FilterCondition> conditions) Returns aFilterCondition
which will only match requests which match all the provided conditions.static FilterCondition
and
(FilterCondition... conditions) Returns aFilterCondition
which will only match requests which match all the provided conditions.static Filter
conditionalFilter
(FilterCondition condition, Filter subFilter) Returns aFilter
which will only invokesubFilter
when the provided filter condition matches the request being processed.static FilterCondition
matchRequestType
(Set<RequestType> types) Returns aFilterCondition
which will only match requests whose type is contained intypes
.static FilterCondition
matchRequestType
(RequestType... types) Returns aFilterCondition
which will only match requests whose type is contained intypes
.static FilterCondition
matchResourcePath
(String regex) Returns aFilterCondition
which will only match requests whose resource path matches the provided regular expression.static FilterCondition
matchResourcePath
(Pattern regex) Returns aFilterCondition
which will only match requests whose resource path matches the provided regular expression.static FilterCondition
not
(FilterCondition condition) Returns aFilterCondition
which will match requests which do not match the provided condition.static FilterCondition
or
(Collection<FilterCondition> conditions) Returns aFilterCondition
which will match requests which match any of the provided conditions.static FilterCondition
or
(FilterCondition... conditions) Returns aFilterCondition
which will match requests which match any of the provided conditions.
-
Method Details
-
and
Returns aFilterCondition
which will only match requests which match all the provided conditions.- Parameters:
conditions
- The conditions which requests must match.- Returns:
- The filter condition.
-
and
Returns aFilterCondition
which will only match requests which match all the provided conditions.- Parameters:
conditions
- The conditions which requests must match.- Returns:
- The filter condition.
-
conditionalFilter
Returns aFilter
which will only invokesubFilter
when the provided filter condition matches the request being processed.- Parameters:
condition
- The filter condition.subFilter
- The sub-filter to be invoked when the condition matches.- Returns:
- The wrapped filter.
-
matchRequestType
Returns aFilterCondition
which will only match requests whose type is contained intypes
.- Parameters:
types
- The request types which should be handled by the filter.- Returns:
- The filter condition.
- See Also:
-
matchRequestType
Returns aFilterCondition
which will only match requests whose type is contained intypes
.- Parameters:
types
- The request types which should be handled by the filter.- Returns:
- The filter condition.
- See Also:
-
matchResourcePath
Returns aFilterCondition
which will only match requests whose resource path matches the provided regular expression.- Parameters:
regex
- The regular expression which must match a request's resource path.- Returns:
- The filter condition.
- See Also:
-
matchResourcePath
Returns aFilterCondition
which will only match requests whose resource path matches the provided regular expression.- Parameters:
regex
- The regular expression which must match a request's resource path.- Returns:
- The filter condition.
- See Also:
-
not
Returns aFilterCondition
which will match requests which do not match the provided condition.- Parameters:
condition
- The condition which requests must not match.- Returns:
- The filter condition.
-
or
Returns aFilterCondition
which will match requests which match any of the provided conditions.- Parameters:
conditions
- The conditions which requests may match.- Returns:
- The filter condition.
-
or
Returns aFilterCondition
which will match requests which match any of the provided conditions.- Parameters:
conditions
- The conditions which requests may match.- Returns:
- The filter condition.
-