Record Class MazeRecord
java.lang.Object
java.lang.Record
dev.despical.mazeengine.storage.MazeRecord
public record MazeRecord(String name, UUID worldId, String worldName, UUID owner, Bounds bounds, long seed, Preset preset, MazeLayout layout, MazeRecord.Status status, boolean hasSnapshot, Instant created, String error, TeleportPoint teleportPoint)
extends Record
Retains the saved state needed to manage and reconstruct one maze.
The record combines persistent identity, owner, world and bounds, generation seed, frozen preset, graph, lifecycle status, snapshot flag, creation time, failure text, and an optional custom teleport point. It describes a saved maze rather than a mutable live Bukkit world.
State changes create replacement records. Regeneration retains the original terrain snapshot, creation timestamp, and custom destination while replacing the seed and graph. MazeRepository persists the record, and the service publishes replacements as operations progress.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes the saved record's preparation, mutation, and recovery lifecycle. -
Constructor Summary
ConstructorsConstructorDescriptionMazeRecord(String name, UUID worldId, String worldName, UUID owner, Bounds bounds, long seed, Preset preset, MazeLayout layout, MazeRecord.Status status, boolean hasSnapshot, Instant created, String error) MazeRecord(String name, UUID worldId, String worldName, UUID owner, Bounds bounds, long seed, Preset preset, MazeLayout layout, MazeRecord.Status status, boolean hasSnapshot, Instant created, String error, TeleportPoint teleportPoint) Creates an instance of aMazeRecordrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbounds()Returns the value of theboundsrecord component.created()Returns the value of thecreatedrecord 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.booleanReturns the value of thehasSnapshotrecord component.layout()Returns the value of thelayoutrecord component.name()Returns the value of thenamerecord component.owner()Returns the value of theownerrecord component.preset()Returns the value of thepresetrecord component.regenerate(long newSeed, MazeLayout newLayout) longseed()Returns the value of theseedrecord component.state(MazeRecord.Status status, boolean snapshot, String error) status()Returns the value of thestatusrecord component.Returns the value of theteleportPointrecord component.final StringtoString()Returns a string representation of this record class.withTeleportPoint(TeleportPoint point) worldId()Returns the value of theworldIdrecord component.Returns the value of theworldNamerecord component.
-
Constructor Details
-
MazeRecord
public MazeRecord(String name, UUID worldId, String worldName, UUID owner, Bounds bounds, long seed, Preset preset, MazeLayout layout, MazeRecord.Status status, boolean hasSnapshot, Instant created, String error) -
MazeRecord
public MazeRecord(String name, UUID worldId, String worldName, UUID owner, Bounds bounds, long seed, Preset preset, MazeLayout layout, MazeRecord.Status status, boolean hasSnapshot, Instant created, String error, TeleportPoint teleportPoint) Creates an instance of aMazeRecordrecord class.- Parameters:
name- the value for thenamerecord componentworldId- the value for theworldIdrecord componentworldName- the value for theworldNamerecord componentowner- the value for theownerrecord componentbounds- the value for theboundsrecord componentseed- the value for theseedrecord componentpreset- the value for thepresetrecord componentlayout- the value for thelayoutrecord componentstatus- the value for thestatusrecord componenthasSnapshot- the value for thehasSnapshotrecord componentcreated- the value for thecreatedrecord componenterror- the value for theerrorrecord componentteleportPoint- the value for theteleportPointrecord component
-
-
Method Details
-
state
-
regenerate
-
withTeleportPoint
-
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. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
worldId
Returns the value of theworldIdrecord component.- Returns:
- the value of the
worldIdrecord component
-
worldName
Returns the value of theworldNamerecord component.- Returns:
- the value of the
worldNamerecord component
-
owner
Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
bounds
Returns the value of theboundsrecord component.- Returns:
- the value of the
boundsrecord component
-
seed
public long seed()Returns the value of theseedrecord component.- Returns:
- the value of the
seedrecord component
-
preset
Returns the value of thepresetrecord component.- Returns:
- the value of the
presetrecord component
-
layout
Returns the value of thelayoutrecord component.- Returns:
- the value of the
layoutrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
hasSnapshot
public boolean hasSnapshot()Returns the value of thehasSnapshotrecord component.- Returns:
- the value of the
hasSnapshotrecord component
-
created
Returns the value of thecreatedrecord component.- Returns:
- the value of the
createdrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
teleportPoint
Returns the value of theteleportPointrecord component.- Returns:
- the value of the
teleportPointrecord component
-