Record Class SerializablePredicate.KeyStartsWith
java.lang.Object
java.lang.Record
com.loomcache.common.protocol.SerializablePredicate.KeyStartsWith
- All Implemented Interfaces:
SerializablePredicate
- Enclosing interface:
SerializablePredicate
public static record SerializablePredicate.KeyStartsWith(String prefix)
extends Record
implements SerializablePredicate
Matches entries whose key starts with the operand.
- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface SerializablePredicate
SerializablePredicate.All, SerializablePredicate.KeyEquals, SerializablePredicate.KeyStartsWith, SerializablePredicate.ValueContains, SerializablePredicate.ValueEquals -
Field Summary
Fields inherited from interface SerializablePredicate
KIND_ALL, KIND_KEY_EQUALS, KIND_KEY_STARTS_WITH, KIND_VALUE_CONTAINS, KIND_VALUE_EQUALS, MAX_ENCODED_BYTES, MAX_OPERAND_BYTES -
Constructor Summary
ConstructorsConstructorDescriptionKeyStartsWith(String prefix) Creates an instance of aKeyStartsWithrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encode()Encode this predicate into a newly-allocated byte array.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.prefix()Returns the value of theprefixrecord component.booleanTest whether the predicate matches the given entry.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
KeyStartsWith
Creates an instance of aKeyStartsWithrecord class.- Parameters:
prefix- the value for theprefixrecord component
-
-
Method Details
-
test
Description copied from interface:SerializablePredicateTest whether the predicate matches the given entry.- Specified by:
testin interfaceSerializablePredicate- Parameters:
key- the entry key (non-null — decoded map keys are always non-null)v- the entry value (may be null for REMOVED events)- Returns:
trueif the entry matches
-
encode
public byte[] encode()Description copied from interface:SerializablePredicateEncode this predicate into a newly-allocated byte array.- Specified by:
encodein interfaceSerializablePredicate
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
prefix
Returns the value of theprefixrecord component.- Returns:
- the value of the
prefixrecord component
-