Record Class CodeType<T extends Code>
java.lang.Object
java.lang.Record
net.tangly.core.codes.CodeType<T>
- Type Parameters:
T- reference code type- Record Components:
clazz- class of the reference code tablecodes- list of all reference code table values
public record CodeType<T extends Code>(@NotNull Class<T extends Code> clazz, @NotNull List<T extends Code> codes)
extends Record
The code type describes a reference code table entity and all the existing code values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn all active codes defined for the code table.clazz()Returns the value of theclazzrecord component.codes()Returns the value of thecodesrecord component.final booleanIndicates whether some other object is "equal to" this one.findCode(int id) Find the code with the given identifier.Find the first code with the given identifier.final inthashCode()Returns a hash code value for this object.Return all inactive codes defined for the code table.Builder for a reference code implemented as an enumeration.Builder for a reference code implemented as a Java class.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CodeType
-
-
Method Details
-
of
Builder for a reference code implemented as an enumeration. Provides a simple approach to map any enumeration type into a reference code.- Type Parameters:
E- reference code type- Parameters:
clazz- class of the reference code table enumeration- Returns:
- code type of the reference code
-
of
Builder for a reference code implemented as a Java class. Provides a pragmatic approach to map a class and a set of instances into a reference code.- Type Parameters:
E- reference code type- Parameters:
clazz- class of the reference code tablecodes- the set of code instances associated with the code class- Returns:
- code type of the reference code
-
activeCodes
-
inactiveCodes
-
findCode
-
findCode
-
toString
-
hashCode
-
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). -
clazz
-
codes
-