Package dev.turboism.sdk.storage
Record Class StorageMutationResult
java.lang.Object
java.lang.Record
dev.turboism.sdk.storage.StorageMutationResult
- Record Components:
changed- whether the operation changed storageerror- structured failure; only a changed recursive delete may also carryStorageErrorCode.PARTIAL_DELETE
Structured result of a copy, move, or delete operation.
-
Constructor Summary
ConstructorsConstructorDescriptionStorageMutationResult(boolean changed, Optional<StorageError> error) Validates the mutation result algebra. -
Method Summary
Modifier and TypeMethodDescriptionbooleanchanged()Returns the value of thechangedrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StorageMutationResult
Validates the mutation result algebra.- Parameters:
changed- whether the mutation changed storageerror- optional structured error- Throws:
NullPointerException- iferrorisnullIllegalArgumentException- if an unchanged operation has no error or a changed operation has an error other than partial deletion
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
changed
public boolean changed()Returns the value of thechangedrecord component.- Returns:
- the value of the
changedrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-