Record Class MazeId
java.lang.Object
java.lang.Record
dev.despical.mazeengine.api.model.MazeId
- Record Components:
value- the case-insensitive maze name, stored in normalized form
Identifies a saved maze using the same naming rules as commands.
Input is normalized to lowercase with Locale.ROOT.
Identifiers contain 1 through 48 ASCII letters, digits, underscores, or
hyphens. Names reserved by the filesystem, such as con and
lpt1, are rejected so persistence can use the identifier safely.
Equality compares normalized values. The identifier is a name, not a unique operation identity; a deleted name may later identify a newly created maze.
-
Constructor Summary
Constructors -
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.@NotNull StringtoString()Returns the normalized identifier itself.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
MazeId
Normalizes and validates a maze name.Surrounding whitespace is not trimmed. Reserved device names are rejected after normalization, including COM1..COM9 and LPT1..LPT9.
- Parameters:
value- the maze name to normalize- Throws:
NullPointerException- ifvalueis nullIllegalArgumentException- if the normalized name is invalid or reserved
-
-
Method Details
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
value
-