Record Class TransferResult
java.lang.Object
java.lang.Record
fr.robie.machineengine.api.transfer.TransferResult
- Record Components:
reason- why less than requested was moved, if known
public record TransferResult(@NotNull TransferResult.Status status, long requested, long moved, @Nullable MachineError reason)
extends Record
Outcome of a transfer (ARCHITECTURE.md ยง10.3). Simulation is a mode (an aborted transaction),
not an outcome.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTransferResult(@NotNull TransferResult.Status status, long requested, long moved, @Nullable MachineError reason) Creates an instance of aTransferResultrecord class. -
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.longmoved()Returns the value of themovedrecord component.static @NotNull TransferResultof(long requested, long moved, @Nullable MachineError reason) @Nullable MachineErrorreason()Returns the value of thereasonrecord component.longReturns the value of therequestedrecord component.@NotNull TransferResult.Statusstatus()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TransferResult
public TransferResult(@NotNull @NotNull TransferResult.Status status, long requested, long moved, @Nullable @Nullable MachineError reason) Creates an instance of aTransferResultrecord class.- Parameters:
status- the value for thestatusrecord componentrequested- the value for therequestedrecord componentmoved- the value for themovedrecord componentreason- the value for thereasonrecord component
-
-
Method Details
-
of
@NotNull public static @NotNull TransferResult of(long requested, long moved, @Nullable @Nullable MachineError reason) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
requested
public long requested()Returns the value of therequestedrecord component.- Returns:
- the value of the
requestedrecord component
-
moved
public long moved()Returns the value of themovedrecord component.- Returns:
- the value of the
movedrecord component
-
reason
-