Package cloud.spawnery.agent.api
Record Class RestoredWorld
java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.RestoredWorld
- Record Components:
generation- the world's new current generation, which holds the restored content; the generation that was current before stays a restore pointrestoredFrom- the generation whose content it holds
-
Constructor Summary
ConstructorsConstructorDescriptionRestoredWorld(long generation, long restoredFrom) Creates an instance of aRestoredWorldrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of thegenerationrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of therestoredFromrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RestoredWorld
public RestoredWorld(long generation, long restoredFrom) Creates an instance of aRestoredWorldrecord class.- Parameters:
generation- the value for thegenerationrecord componentrestoredFrom- the value for therestoredFromrecord component
-
-
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. All components in this record class are compared with '=='. -
generation
public long generation()Returns the value of thegenerationrecord component.- Returns:
- the value of the
generationrecord component
-
restoredFrom
public long restoredFrom()Returns the value of therestoredFromrecord component.- Returns:
- the value of the
restoredFromrecord component
-