com.ca.commons.datamodel
Class DataModelEnumValue
java.lang.Object
com.ca.commons.datamodel.DataModelEnumValue
- All Implemented Interfaces:
- Serializable, Comparable<DataModelEnumValue>
public final class DataModelEnumValue
- extends Object
- implements Comparable<DataModelEnumValue>, Serializable
Represents a single enum entry consisting of a symbolic name and a
reference to the parent enum definition.
- See Also:
- Serialized Form
DataModelEnumValue
public DataModelEnumValue(@NotNull
String name,
int ordinal,
@Nullable
DataModelEnumDef enumDef,
@Nullable
String dispayName)
DataModelEnumValue
public DataModelEnumValue(@NotNull
String name,
int ordinal,
@Nullable
DataModelEnumDef enumDef,
@Nullable
String dispayName,
boolean representsNone)
- Only packages that are implementing the Data Model API
should construct instances of this class.
- Parameters:
name - The name of the enum value.ordinal - The oridinal.enumDef - The enumeration definition this value belongs to.dispayName - The text to display to the user when referring torepresentsNone - Does this enum value represent absence of attribute value
this value.
toName
@NotNull
public static com.ca.commons.functional.Fn<DataModelEnumValue,String> toName()
matchName
@NotNull
public static com.ca.commons.functional.Pred<DataModelEnumValue> matchName(@NotNull
String name)
matchOrdinal
@NotNull
public static com.ca.commons.functional.Pred<DataModelEnumValue> matchOrdinal(int ordinal)
fnDef
public static com.ca.commons.functional.Fn<DataModelEnumValue,DataModelEnumDef> fnDef()
enumDefEquality
public static boolean enumDefEquality(@Nullable
DataModelEnumDef def1,
@Nullable
DataModelEnumDef def2)
getEnumDef
@NotNull
public DataModelEnumDef getEnumDef()
- Set value checking that it is valid for parent enum.
getName
@NotNull
public String getName()
getOrdinal
public int getOrdinal()
getDisplayName
@NotNull
public String getDisplayName()
isRepresentsNone
public boolean isRepresentsNone()
changeOrdinal
@NotNull
public DataModelEnumValue changeOrdinal(int newOrdinal)
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
compareTo
public int compareTo(DataModelEnumValue o)
- Specified by:
compareTo in interface Comparable<DataModelEnumValue>
Created 2011-07-14 13:27 EST