public final class PredicateUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
canonicalizeAttribute(String attribute)
Produces canonical attribute representation by stripping an unnecessary
"this." qualifier from the passed attribute, if any.
|
static String |
constructCanonicalCompositeIndexName(String[] components)
Constructs a canonical index name from the given index components.
|
static int |
estimatedSizeOf(Collection<QueryableEntry> result)
In case of AndResultSet and OrResultSet calling size() may be very
expensive so quicker estimatedSize() is used.
|
static boolean |
isEqualPredicate(Predicate predicate) |
static boolean |
isNull(Comparable value) |
static boolean |
isRangePredicate(Predicate predicate) |
static String[] |
parseOutCompositeIndexComponents(String name)
Parses the given index name into components.
|
public static int estimatedSizeOf(Collection<QueryableEntry> result)
result
- result of a predicated searchAndResultSet.estimatedSize()
,
OrResultSet.estimatedSize()
public static boolean isNull(Comparable value)
true
if the given value is considered as a null-like by
predicates and indexes, false
otherwise.public static boolean isRangePredicate(Predicate predicate)
true
if the given predicate is a RangePredicate
,
false
otherwise.public static boolean isEqualPredicate(Predicate predicate)
true
if the given predicate is an EqualPredicate
,
false
otherwise.public static String canonicalizeAttribute(String attribute)
attribute
- the attribute to canonicalize.constructCanonicalCompositeIndexName(java.lang.String[])
public static String[] parseOutCompositeIndexComponents(String name)
name
- the index name to parse.null
if the given index name
doesn't describe a composite index components.IllegalArgumentException
- if the given index name is empty.IllegalArgumentException
- if the given index name contains empty
components.IllegalArgumentException
- if the given index name contains
duplicate components.IllegalArgumentException
- if the given index name has more than
255 components.constructCanonicalCompositeIndexName(java.lang.String[])
public static String constructCanonicalCompositeIndexName(String[] components)
A canonical name is a comma-separated list of index components with a single space character going after every comma.
It's a caller's responsibility to canonicalize individual components
as specified by canonicalizeAttribute(java.lang.String)
.
components
- the index components to construct the canonical index
name from.Copyright © 2019 Hazelcast, Inc.. All Rights Reserved.