Record Class ElementDesignationRecord

java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementDesignationRecord
Record Components:
designation -
value -

public record ElementDesignationRecord(String designation, String value) extends Record
Parses a designated component. A designated component is one in which there is a prefix for
  • Field Details

    • DESIGNATION_SEPARATOR

      public static final String DESIGNATION_SEPARATOR
  • Constructor Details

    • ElementDesignationRecord

      public ElementDesignationRecord(String designation, String value)
      Creates an instance of a ElementDesignationRecord record class.
      Parameters:
      designation - the value for the designation record component
      value - the value for the value record component
  • Method Details

    • parse

      public static ElementDesignationRecord parse(String value)
      Parses and, if fails, throw an instance of InvalidDesignationException if parsing fails.
      Parameters:
      value - the value
      Returns:
      the record, never null
      Throws:
      InvalidDesignationException - if the designation does not parse.
    • tryParse

      public static Optional<ElementDesignationRecord> tryParse(String value)
      Tries to parse a designated component.
      Parameters:
      value - the value
      Returns:
      the Optional of the parsed value
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • designation

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

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