Record Class Transaction.Operation
java.lang.Object
java.lang.Record
com.loomcache.server.transaction.Transaction.Operation
- Record Components:
type- the type of operation (must not be null)key- the key to operate on (must not be null)value- the value for PUT operations (null for DELETE/GET)mapName- optional logical-map override for cross-group atomic batches where different operations target different maps within the same Raft group. Whennull, the operation applies to the group's single logical map recorded on the enclosingReplicatedTransactionCommand.
- Enclosing class:
Transaction
public static record Transaction.Operation(Transaction.OperationType type, String key, @Nullable String value, @Nullable String mapName)
extends Record
Operation to execute in the THEN or ELSE branch of a transaction.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionOperation(Transaction.OperationType type, String key, @Nullable String value) Convenience constructor for single-map transactions — defaultsmapName()tonull.Operation(Transaction.OperationType type, String key, @Nullable String value, @Nullable String mapName) Compact constructor validating type and key. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.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.@Nullable Stringvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
Operation
public Operation(Transaction.OperationType type, String key, @Nullable String value, @Nullable String mapName) Compact constructor validating type and key.- Throws:
NullPointerException- if type or key is null
-
Operation
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). -
type
-
key
-
value
-
mapName
-