public abstract class Selectors extends Object
Selector
s.Modifier and Type | Class and Description |
---|---|
static class |
Selectors.AnonymousKey |
Constructor and Description |
---|
Selectors() |
Modifier and Type | Method and Description |
---|---|
static Selector |
$()
A short-hand alias for
anonymous() . |
static Selector |
$(String fmt,
Object... args)
Creates a
Selector based on the given string format and arguments. |
static <T> Selector<T> |
$(T obj)
A short-hand alias for
object(T) . |
static Selector |
anonymous()
Creates an anonymous
Selector . |
static Selector |
matchAll()
Creates a
Selector that matches
all objects. |
static <T> Selector<T> |
object(T obj)
Creates a
Selector based on the given object. |
static Selector |
predicate(Predicate<Object> predicate)
|
static Selector |
R(String regex)
A short-hand alias for
regex(String) . |
static Selector |
regex(String regex)
Creates a
Selector based on the given regular expression. |
static Selector |
setMembership(Set set)
Creates a
Selector that matches
objects on set membership. |
static ClassSelector |
T(Class<?> supertype)
A short-hand alias for
type(Class) . |
static ClassSelector |
type(Class<?> supertype)
Creates a
Selector based on the given class type that matches objects whose type is
assignable according to Class.isAssignableFrom(Class) . |
static Selector |
U(String uri)
A short-hand alias for
uri(String) . |
static Selector |
uri(String uri)
Creates a
Selector based on a URI template. |
public static Selector anonymous()
Selector
.ObjectSelector
public static Selector $()
anonymous()
.
Creates an anonymous Selector
.ObjectSelector
public static <T> Selector<T> object(T obj)
Selector
based on the given object.obj
- The object to use for matchingObjectSelector
.ObjectSelector
public static <T> Selector<T> $(T obj)
obj
- The object to use for matchingObjectSelector
.ObjectSelector
public static Selector $(String fmt, Object... args)
Selector
based on the given string format and arguments.fmt
- The String.format
style format specificationargs
- The format argsObjectSelector
.ObjectSelector
,
String.format(String, Object...)
public static Selector regex(String regex)
Selector
based on the given regular expression.regex
- The regular expression to compile and use for matchingRegexSelector
.RegexSelector
public static Selector R(String regex)
regex(String)
.
Creates a Selector
based on the given regular expression.regex
- The regular expression to compile and use for matchingRegexSelector
.RegexSelector
public static ClassSelector type(Class<?> supertype)
Selector
based on the given class type that matches objects whose type is
assignable according to Class.isAssignableFrom(Class)
.supertype
- The supertype to use for matchingClassSelector
.ClassSelector
public static ClassSelector T(Class<?> supertype)
type(Class)
.
Creates a Selector
based on the given class type that matches objects whose type is
assignable according to Class.isAssignableFrom(Class)
.supertype
- The supertype to compare.ClassSelector
.ClassSelector
public static Selector uri(String uri)
Selector
based on a URI template.uri
- The string to compile into a URI template and use for matchingUriPathSelector
.UriPathTemplate
,
UriPathSelector
public static Selector U(String uri)
uri(String)
.
Creates a Selector
based on a URI template.uri
- The string to compile into a URI template and use for matchingUriPathSelector
.UriPathTemplate
,
UriPathSelector
public static Selector predicate(Predicate<Object> predicate)
predicate
- The Predicate
to delegate to when matching objects.PredicateSelector
public static Selector matchAll()
Selector
that matches
all objects.MatchAllSelector
MatchAllSelector
public static Selector setMembership(Set set)
Selector
that matches
objects on set membership.SetMembershipSelector
SetMembershipSelector
Copyright © 2017. All rights reserved.