Record Class flixw.LockField
java.lang.Object
java.lang.Record
flixw.LockField
- Enclosing class:
flixw
static record flixw.LockField(String table, String key, boolean required, String pattern, String what)
extends Record
One key in lock.toml: the table it lives in, whether that table may omit it, the
shape its value must have, and the sentence a diagnostic uses to describe it.
The lock's shape was previously stated in three places --
flixw.lockText(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) wrote it,
flixw.readLock(java.nio.file.Path) read it, and the documentation described it -- with nothing keeping
them in step, and a published JSON Schema would have been a fourth. So it is stated
once here, and the writer, the reader and the schema are all derived from this list.
pattern is deliberately written in the intersection of Java's regex dialect
and ECMA-262's: it is compiled by String.matches on every run, and by
whatever JSON Schema validator reads the published file. It carries no anchors,
because Java implies them and JSON Schema does not.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thekeyrecord component.private final StringThe field for thepatternrecord component.private final booleanThe field for therequiredrecord component.private final StringThe field for thetablerecord component.private final StringThe field for thewhatrecord component. -
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.key()Returns the value of thekeyrecord component.(package private) Stringname()How a diagnostic names this key: `[compiler] sha256`, or a bare key at the root.pattern()Returns the value of thepatternrecord component.booleanrequired()Returns the value of therequiredrecord component.table()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.what()Returns the value of thewhatrecord component.
-
Field Details
-
table
The field for thetablerecord component. -
key
The field for thekeyrecord component. -
required
private final boolean requiredThe field for therequiredrecord component. -
pattern
The field for thepatternrecord component. -
what
The field for thewhatrecord component.
-
-
Constructor Details
-
LockField
Creates an instance of aLockFieldrecord class.- Parameters:
table- the value for thetablerecord componentkey- the value for thekeyrecord componentrequired- the value for therequiredrecord componentpattern- the value for thepatternrecord componentwhat- the value for thewhatrecord component
-
-
Method Details
-
name
String name()How a diagnostic names this key: `[compiler] sha256`, or a bare key at the root. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
what
Returns the value of thewhatrecord component.- Returns:
- the value of the
whatrecord component
-