Record Class PaintRecord

java.lang.Object
java.lang.Record
dev.despical.pixelpainter.storage.PaintRecord
Record Components:
id - twelve-character hexadecimal journal identifier
owner - creating player UUID
world - target world UUID
image - source image name
created - creation timestamp in epoch milliseconds
bounds - inclusive reserved region
changes - original and target block states

public record PaintRecord(String id, UUID owner, UUID world, String image, long created, Bounds bounds, List<PaintRecord.Change> changes) extends Record
Represents a durable undo journal written before its painting changes terrain.

Owner and world UUIDs identify access and the target world. Inclusive bounds reserve its area against overlapping paintings. The copied change list records both original and intended block properties.

A record can describe interrupted or partial work. Recovery checks live block data rather than assuming every change was applied. Block-entity NBT is not stored because creation refuses to overwrite those blocks.

  • Constructor Details

  • 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 the compare method from their corresponding wrapper classes.
      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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • owner

      public UUID owner()
      Returns the value of the owner record component.
      Returns:
      the value of the owner record component
    • world

      public UUID world()
      Returns the value of the world record component.
      Returns:
      the value of the world record component
    • image

      public String image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • created

      public long created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • bounds

      public Bounds bounds()
      Returns the value of the bounds record component.
      Returns:
      the value of the bounds record component
    • changes

      public List<PaintRecord.Change> changes()
      Returns the value of the changes record component.
      Returns:
      the value of the changes record component