Record Class Transaction.Condition
java.lang.Object
java.lang.Record
com.loomcache.server.transaction.Transaction.Condition
- Record Components:
key- the key to check (must not be null)type- the type of condition to evaluate (must not be null)expected- the expected value for comparison (can be null)mapName- optional logical-map override for cross-group atomic batches where different operations target different maps within the same Raft group. Whennull, the condition resolves against the group's single logical map recorded on the enclosingReplicatedTransactionCommand.
- Enclosing class:
Transaction
public static record Transaction.Condition(String key, Transaction.ConditionType type, @Nullable Object expected, @Nullable String mapName)
extends Record
Condition to evaluate in the IF branch of a transaction.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCondition(String key, Transaction.ConditionType type, @Nullable Object expected) Convenience constructor for single-map transactions — defaultsmapName()tonull.Condition(String key, Transaction.ConditionType type, @Nullable Object expected, @Nullable String mapName) Compact constructor validating key and type. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.@Nullable Objectexpected()Returns the value of theexpectedrecord component.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.@Nullable StringmapName()Returns the value of themapNamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Condition
public Condition(String key, Transaction.ConditionType type, @Nullable Object expected, @Nullable String mapName) Compact constructor validating key and type.- Throws:
NullPointerException- if key or type is null
-
Condition
Convenience constructor for single-map transactions — defaultsmapName()tonull.
-
-
Method Details
-
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). -
key
-
type
-
expected
-
mapName
-