public class Predicates extends Object
Modifier and Type | Method and Description |
---|---|
static Predicate |
and(Predicate... predicates)
Creates a predicate that returns true if an only if the given predicates all
return true.
|
static Predicate |
contains(ExchangeAttribute attribute,
String... values)
Returns true if the given attribute is present and contains one of the provided value
|
static Predicate |
exists(ExchangeAttribute attribute)
Return a predicate that will return true if the given attribute is not null and not empty
|
static Predicate |
falsePredicate()
predicate that always returns false
|
static Predicate |
maxContentSize(long size)
Predicate that returns true if the Content-Size of a request is above a
given value.
|
static Predicate |
minContentSize(long size)
Predicate that returns true if the Content-Size of a request is below a
given value.
|
static Predicate |
not(Predicate predicate)
Creates a predicate that returns true if the given predicate returns
false
|
static Predicate |
or(Predicate... predicates)
Creates a predicate that returns true if any of the given predicates
return true.
|
static Predicate |
path(String path)
creates a predicate that returns true if the given path matches exactly
|
static Predicate |
paths(String... paths)
creates a predicate that returns true if any of the given paths match exactly
|
static Predicate |
prefix(String path)
creates a predicate that returns true if the given relative path starts with the provided prefix
|
static Predicate |
prefixs(String... paths)
creates a predicate that returns true if the relative request path matches any of the provided prefixes
|
static Predicate |
regex(ExchangeAttribute attribute,
String pattern)
Creates a predicate that matches the given attribute against a regex.
|
static Predicate |
regex(ExchangeAttribute attribute,
String pattern,
boolean requireFullMatch)
Creates a predicate that matches the given attribute against a regex.
|
static Predicate |
regex(String attribute,
String pattern,
ClassLoader classLoader,
boolean requireFullMatch)
Creates a predicate that matches the given attribute against a regex.
|
static Predicate |
suffix(String path)
creates a predicate that returns true if the request path ends with the provided suffix
|
static Predicate |
suffixs(String... paths)
creates a predicate that returns true if the request path ends with any of the provided suffixs
|
static Predicate |
truePredicate()
predicate that always returns true
|
public static Predicate and(Predicate... predicates)
public static Predicate or(Predicate... predicates)
public static Predicate not(Predicate predicate)
public static Predicate path(String path)
public static Predicate paths(String... paths)
public static Predicate suffix(String path)
public static Predicate suffixs(String... paths)
public static Predicate prefix(String path)
public static Predicate prefixs(String... paths)
public static Predicate maxContentSize(long size)
public static Predicate minContentSize(long size)
public static Predicate truePredicate()
public static Predicate falsePredicate()
public static Predicate exists(ExchangeAttribute attribute)
attribute
- The attribute to checkpublic static Predicate contains(ExchangeAttribute attribute, String... values)
attribute
- The exchange attributevalues
- The values to check forpublic static Predicate regex(ExchangeAttribute attribute, String pattern)
attribute
- The attributepattern
- The patternpublic static Predicate regex(ExchangeAttribute attribute, String pattern, boolean requireFullMatch)
requireFullMatch
- If a full match is requiredattribute
- The attributepattern
- The patternpublic static Predicate regex(String attribute, String pattern, ClassLoader classLoader, boolean requireFullMatch)
requireFullMatch
- If a full match is requiredattribute
- The attributepattern
- The patternCopyright © 2013 JBoss by Red Hat. All rights reserved.