Class PredicateBuilder<K,V>
java.lang.Object
com.loomcache.server.query.PredicateBuilder<K,V>
- Type Parameters:
K- the map key typeV- the map value type
- All Implemented Interfaces:
MapPredicate<K,V>
Fluent predicate builder for distributed map queries.
Mirrors Hazelcast's PredicateBuilder shape:
PredicateBuilder.EntryObject<String, Employee> e =
Predicates.<String, Employee>newPredicateBuilder().getEntryObject();
MapPredicate<String, Employee> predicate =
e.is("active").and(e.get("age").lessThan(30));
Each terminal PredicateBuilder.EntryObject operation returns a new immutable builder predicate, so the same
entry object can be reused safely while composing predicates.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceEntry-level fluent predicate operations. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty builder handle for obtaining anPredicateBuilder.EntryObject. -
Method Summary
Modifier and TypeMethodDescriptionand(MapPredicate<K, V> other) Composes this predicate with another using logical AND.Returns the last attribute represented by this builder.Returns the entry object used to select key/value attributes and create terminal predicates.or(MapPredicate<K, V> other) Composes this predicate with another using logical OR.voidsetAttribute(String attribute) Updates the attribute metadata exposed for Hazelcast-compatible callers.booleanTests whether the given map entry matches this predicate.toString()
-
Constructor Details
-
PredicateBuilder
public PredicateBuilder()Creates an empty builder handle for obtaining anPredicateBuilder.EntryObject.
-
-
Method Details
-
getAttribute
Returns the last attribute represented by this builder.- Returns:
- the selected attribute path
-
setAttribute
Updates the attribute metadata exposed for Hazelcast-compatible callers.- Parameters:
attribute- attribute path
-
getEntryObject
Returns the entry object used to select key/value attributes and create terminal predicates.- Returns:
- a reusable entry object
-
and
Composes this predicate with another using logical AND.- Parameters:
other- predicate to combine with- Returns:
- a new builder wrapping the composed predicate
-
or
Composes this predicate with another using logical OR.- Parameters:
other- predicate to combine with- Returns:
- a new builder wrapping the composed predicate
-
test
Description copied from interface:MapPredicateTests whether the given map entry matches this predicate.- Specified by:
testin interfaceMapPredicate<K,V> - Parameters:
key- the entry key (non-null)value- the entry value (non-null)- Returns:
trueif the entry matches,falseotherwise
-
toString
-