Package edu.suffolk.litlab.efsp.ecfcodes
Record Class NameAndCodeType
java.lang.Object
java.lang.Record
edu.suffolk.litlab.efsp.ecfcodes.NameAndCodeType
- All Implemented Interfaces:
NameAndCode,Comparable<NameAndCode>
public record NameAndCodeType(String name, String code)
extends Record
implements Comparable<NameAndCode>, NameAndCode
-
Constructor Summary
ConstructorsConstructorDescriptionNameAndCodeType(String name, String code) Creates an instance of aNameAndCodeTyperecord class. -
Method Summary
Modifier and TypeMethodDescriptioncode()Returns the value of thecoderecord component.intcompareTo(NameAndCode arg0) final booleanIndicates whether some other object is "equal to" this one.getCode()Should be deprecated and removed eventually.getName()Should be deprecated and removed eventually.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NameAndCodeType
Creates an instance of aNameAndCodeTyperecord class.- Parameters:
name- the value for thenamerecord componentcode- the value for thecoderecord component
-
-
Method Details
-
getName
Description copied from interface:NameAndCodeShould be deprecated and removed eventually.- Specified by:
getNamein interfaceNameAndCode
-
getCode
Description copied from interface:NameAndCodeShould be deprecated and removed eventually.- Specified by:
getCodein interfaceNameAndCode
-
compareTo
- Specified by:
compareToin interfaceComparable<NameAndCode>
-
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). -
name
Returns the value of thenamerecord component.- Specified by:
namein interfaceNameAndCode- Returns:
- the value of the
namerecord component
-
code
Returns the value of thecoderecord component.- Specified by:
codein interfaceNameAndCode- Returns:
- the value of the
coderecord component
-