public abstract class FilterSpec extends Object implements Serializable
| Modifier and Type | Method and Description |
|---|---|
static FilterSpec |
all(Collection<FilterSpec> specs)
Create a filter which matches all of the given sub-filters.
|
static FilterSpec |
all(FilterSpec... specs)
Create a filter which matches all of the given sub-filters.
|
static FilterSpec |
any(Collection<FilterSpec> specs)
Create a filter which matches any of the given sub-filters.
|
static FilterSpec |
any(FilterSpec... specs)
Create a filter which matches any of the given sub-filters.
|
static FilterSpec |
approx(String attribute,
String value)
Create a filter specification which approximately matches one attribute value.
|
static FilterSpec |
equal(String attribute,
byte[] value)
Create a filter specification which matches one attribute value.
|
static FilterSpec |
equal(String attribute,
String value)
Create a filter specification which matches one attribute value.
|
static String |
escape(String str)
Escape an attribute string, suitable for putting into a filter.
|
static void |
escapeTo(String str,
StringBuilder b)
Escape an attribute string, suitable for putting into a filter.
|
static FilterSpec |
fromString(String string)
Create a new filter from a string.
|
static FilterSpec |
greaterOrEqual(String attribute,
byte[] value)
Create a filter specification which matches when the given attribute's value is lexicographically greater than or
equal to the given value.
|
static FilterSpec |
greaterOrEqual(String attribute,
String value)
Create a filter specification which matches when the given attribute's value is lexicographically greater than or
equal to the given value.
|
static FilterSpec |
hasAttribute(String attribute)
Create a filter specification which matches when the given attribute is present.
|
static FilterSpec |
lessOrEqual(String attribute,
byte[] value)
Create a filter specification which matches when the given attribute's value is lexicographically less than or
equal to the given value.
|
static FilterSpec |
lessOrEqual(String attribute,
String value)
Create a filter specification which matches when the given attribute's value is lexicographically less than or
equal to the given value.
|
abstract boolean |
matchesMulti(Map<String,? extends Collection<AttributeValue>> attributes)
Determine whether the given attribute multi-map matches this filter.
|
abstract boolean |
matchesSimple(Map<String,AttributeValue> attributes)
Determine whether the given simple attribute map matches this filter.
|
static FilterSpec |
not(FilterSpec spec)
Create a filter which matches the inverse of the given filter.
|
static FilterSpec |
substringMatch(String attribute,
String initialPart,
String finalPart)
Create a filter specification which matches a leading or trailing (or both) substring of one attribute value.
|
String |
toString()
Get the string representation of this filter.
|
public abstract boolean matchesSimple(Map<String,AttributeValue> attributes)
attributes - the attribute maptrue if the map matches, false otherwisepublic abstract boolean matchesMulti(Map<String,? extends Collection<AttributeValue>> attributes)
attributes - the attribute maptrue if the map matches, false otherwisepublic static FilterSpec fromString(String string)
string - the filter stringpublic static FilterSpec all(FilterSpec... specs)
specs - the sub-filterspublic static FilterSpec all(Collection<FilterSpec> specs)
specs - the sub-filterspublic static FilterSpec any(FilterSpec... specs)
specs - the sub-filterspublic static FilterSpec any(Collection<FilterSpec> specs)
specs - the sub-filterspublic static FilterSpec not(FilterSpec spec)
spec - the sub-filterpublic static FilterSpec equal(String attribute, String value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec equal(String attribute, byte[] value)
attribute - the attribute namevalue - the attribute byte valuepublic static FilterSpec substringMatch(String attribute, String initialPart, String finalPart)
attribute - the attribute nameinitialPart - the initial part, or "" to match any initial partfinalPart - the final part, or "" to match any final partpublic static FilterSpec approx(String attribute, String value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec greaterOrEqual(String attribute, String value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec greaterOrEqual(String attribute, byte[] value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec lessOrEqual(String attribute, String value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec lessOrEqual(String attribute, byte[] value)
attribute - the attribute namevalue - the attribute valuepublic static FilterSpec hasAttribute(String attribute)
attribute - the attribute namepublic static String escape(String str)
str - the string to escapepublic static void escapeTo(String str, StringBuilder b)
str - the string to escapeb - the builder to append toCopyright © 2017 JBoss by Red Hat. All rights reserved.