Record Class SerializablePredicate.ValueContains
java.lang.Object
java.lang.Record
com.loomcache.common.protocol.SerializablePredicate.ValueContains
- All Implemented Interfaces:
SerializablePredicate
- Enclosing interface:
SerializablePredicate
public static record SerializablePredicate.ValueContains(String substring)
extends Record
implements SerializablePredicate
Matches entries whose value contains the operand as a substring.
- 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
ConstructorsConstructorDescriptionValueContains(String substring) Creates an instance of aValueContainsrecord 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.Returns the value of thesubstringrecord component.booleanTest whether the predicate matches the given entry.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ValueContains
Creates an instance of aValueContainsrecord class.- Parameters:
substring- the value for thesubstringrecord 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). -
substring
Returns the value of thesubstringrecord component.- Returns:
- the value of the
substringrecord component
-