Record Class RestorePoint

java.lang.Object
java.lang.Record
cloud.spawnery.agent.api.RestorePoint
Record Components:
generation - the generation's number; a higher one is newer
taken - when the node took the snapshot, not when it reached the object store
current - whether this is the world as it stands, which a restore cannot pick

public record RestorePoint(long generation, Instant taken, boolean current) extends Record
One generation of a private server's world that SpawneryApi.restoreWorld(java.lang.String, java.lang.String, long) can go back to.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RestorePoint(long generation, Instant taken, boolean current)
    Creates an instance of a RestorePoint record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the current record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    long
    Returns the value of the generation record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the taken record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RestorePoint

      public RestorePoint(long generation, Instant taken, boolean current)
      Creates an instance of a RestorePoint record class.
      Parameters:
      generation - the value for the generation record component
      taken - the value for the taken record component
      current - the value for the current record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • generation

      public long generation()
      Returns the value of the generation record component.
      Returns:
      the value of the generation record component
    • taken

      public Instant taken()
      Returns the value of the taken record component.
      Returns:
      the value of the taken record component
    • current

      public boolean current()
      Returns the value of the current record component.
      Returns:
      the value of the current record component