Interface SerializablePredicate
public sealed interface SerializablePredicate
Serializable predicate evaluated by LoomCache servers for filtered scans, entry-listener filters,
and continuous-query cache seeding.
This is not a Java functional interface: implementations must provide both local
test(String, String) behavior and a bounded serialized representation. Supported callers
should use the built-in encodings produced by the factory methods below.
Support boundary: the production-supported application surface is the static
factory methods on this interface plus test(String, String) for local evaluation. The
nested implementation types, byte-kind constants, and serialization hooks are hidden support for
the client/server protocol. Applications should not persist, parse,
or construct the predicate byte encoding directly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic SerializablePredicateall()Returns a predicate that matches every entry.static SerializablePredicateReturns a predicate that matches entries whose key equalsvalue.static SerializablePredicatekeyStartsWith(String prefix) Returns a predicate that matches entries whose key starts withprefix.booleanEvaluates this predicate locally against a key/value pair using the same semantics as the server-supported predicate family.static SerializablePredicatevalueContains(String substring) Returns a predicate that matches values containingsubstring.static SerializablePredicatevalueEquals(String value) Returns a predicate that matches entries whose value equalsvalue.
-
Method Details
-
all
Returns a predicate that matches every entry.- Returns:
- predicate that matches all entries
-
keyEquals
Returns a predicate that matches entries whose key equalsvalue.- Parameters:
value- key value to match- Returns:
- predicate that matches entries with the exact key
- Throws:
NullPointerException- ifvalueis null
-
valueEquals
Returns a predicate that matches entries whose value equalsvalue.- Parameters:
value- entry value to match- Returns:
- predicate that matches entries with the exact value
- Throws:
NullPointerException- ifvalueis null
-
keyStartsWith
Returns a predicate that matches entries whose key starts withprefix.- Parameters:
prefix- non-empty key prefix to match- Returns:
- predicate that matches keys starting with
prefix - Throws:
NullPointerException- ifprefixis nullIllegalArgumentException- ifprefixis empty
-
valueContains
Returns a predicate that matches values containingsubstring.Values longer than 64K UTF-16 code units are treated as non-matches to keep server-side scan work bounded.
- Parameters:
substring- non-empty substring to match- Returns:
- predicate that matches values containing
substring - Throws:
NullPointerException- ifsubstringis nullIllegalArgumentException- ifsubstringis empty
-
test
-