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 | authRequired() A predicate that returns true if authentication is required |
static Predicate | contains(ExchangeAttribute attribute, String... values) Returns true if the given attribute is present and contains one of the provided value. |
static Predicate | equals(ExchangeAttribute[] attributes) Creates a procedure that returns true if the given ExchangeAttributes are equal. |
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 which 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 | parse(String predicate) parses the predicate string, and returns the result, using the TCCL to load predicate definitions |
static Predicate | parse(String predicate, ClassLoader classLoader) parses the predicate string, and returns the result |
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 | prefixes(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 | secure() |
static Predicate | suffix(String path) Creates a predicate that returns true if the request path ends with the provided suffix. |
static Predicate | suffixes(String... paths) Creates a predicate that returns true if the request path ends with any of the provided suffixes. |
static Predicate | truePredicate() Prediction which always returns true |
public static Predicate equals(ExchangeAttribute[] attributes)
attributes
- to be compared in the predictor.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 suffixes(String... paths)
public static Predicate prefix(String path)
public static Predicate prefixes(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 check whether it exists or not.public static Predicate contains(ExchangeAttribute attribute, String... values)
attribute
- The exchange attribute.values
- The values to check for.public static Predicate regex(ExchangeAttribute attribute, String pattern)
attribute
- The exchange attribute to check against.pattern
- The pattern to look for.public static Predicate regex(ExchangeAttribute attribute, String pattern, boolean requireFullMatch)
requireFullMatch
- If a full match is required in order to return true.attribute
- The attribute to check against.pattern
- The pattern to look for.public static Predicate regex(String attribute, String pattern, ClassLoader classLoader, boolean requireFullMatch)
requireFullMatch
- If a full match is required in order to return true.attribute
- The attribute to check against.pattern
- The pattern to look for.public static Predicate authRequired()
public static Predicate parse(String predicate)
predicate
- The prediate stringpublic static Predicate parse(String predicate, ClassLoader classLoader)
predicate
- The prediate stringclassLoader
- The class loader to load the predicates frompublic static Predicate secure()
Copyright © 2017 JBoss by Red Hat. All rights reserved.