Record Class ElementDesignationRecord
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementDesignationRecord
- Record Components:
designation
-value
-
Parses a designated component. A designated component is one in which there is a prefix for
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElementDesignationRecord
(String designation, String value) Creates an instance of aElementDesignationRecord
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedesignation
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static ElementDesignationRecord
Parses and, if fails, throw an instance ofInvalidDesignationException
if parsing fails.final String
toString()
Returns a string representation of this record class.static Optional
<ElementDesignationRecord> Tries to parse a designated component.value()
Returns the value of thevalue
record component.
-
Field Details
-
DESIGNATION_SEPARATOR
-
-
Constructor Details
-
ElementDesignationRecord
Creates an instance of aElementDesignationRecord
record class.- Parameters:
designation
- the value for thedesignation
record componentvalue
- the value for thevalue
record component
-
-
Method Details
-
parse
Parses and, if fails, throw an instance ofInvalidDesignationException
if parsing fails.- Parameters:
value
- the value- Returns:
- the record, never null
- Throws:
InvalidDesignationException
- if the designation does not parse.
-
tryParse
Tries to parse a designated component.- Parameters:
value
- the value- Returns:
- the
Optional
of the parsed value
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
designation
Returns the value of thedesignation
record component.- Returns:
- the value of the
designation
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-