Record Class 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

    Fields
    Modifier and Type
    Field
    Description
    private final String
    The field for the key record component.
    private final String
    The field for the pattern record component.
    private final boolean
    The field for the required record component.
    private final String
    The field for the table record component.
    private final String
    The field for the what record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LockField(String table, String key, boolean required, String pattern, String what)
    Creates an instance of a LockField record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    key()
    Returns the value of the key record component.
    (package private) String
    How a diagnostic names this key: `[compiler] sha256`, or a bare key at the root.
    Returns the value of the pattern record component.
    boolean
    Returns the value of the required record component.
    Returns the value of the table record component.
    final String
    Returns a string representation of this record class.
    Returns the value of the what record component.

    Methods inherited from class java.lang.Object

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

    • table

      private final String table
      The field for the table record component.
    • key

      private final String key
      The field for the key record component.
    • required

      private final boolean required
      The field for the required record component.
    • pattern

      private final String pattern
      The field for the pattern record component.
    • what

      private final String what
      The field for the what record component.
  • Constructor Details

    • LockField

      LockField(String table, String key, boolean required, String pattern, String what)
      Creates an instance of a LockField record class.
      Parameters:
      table - the value for the table record component
      key - the value for the key record component
      required - the value for the required record component
      pattern - the value for the pattern record component
      what - the value for the what record component
  • Method Details

    • name

      String name()
      How a diagnostic names this key: `[compiler] sha256`, or a bare key at the root.
    • 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.
    • table

      public String table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • key

      public String key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component
    • required

      public boolean required()
      Returns the value of the required record component.
      Returns:
      the value of the required record component
    • pattern

      public String pattern()
      Returns the value of the pattern record component.
      Returns:
      the value of the pattern record component
    • what

      public String what()
      Returns the value of the what record component.
      Returns:
      the value of the what record component