com.ca.commons.datamodel
Class DataModelEnumValue

java.lang.Object
  extended by 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

Constructor Summary
DataModelEnumValue(String name, int ordinal, DataModelEnumDef enumDef, String dispayName)
           
DataModelEnumValue(String name, int ordinal, DataModelEnumDef enumDef, String dispayName, boolean representsNone)
          Only packages that are implementing the Data Model API should construct instances of this class.
 
Method Summary
 DataModelEnumValue changeOrdinal(int newOrdinal)
           
 int compareTo(DataModelEnumValue o)
           
static boolean enumDefEquality(DataModelEnumDef def1, DataModelEnumDef def2)
           
 boolean equals(Object o)
           
static com.ca.commons.functional.Fn<DataModelEnumValue,DataModelEnumDef> fnDef()
           
 String getDisplayName()
           
 DataModelEnumDef getEnumDef()
          Set value checking that it is valid for parent enum.
 String getName()
           
 int getOrdinal()
           
 int hashCode()
           
 boolean isRepresentsNone()
           
static com.ca.commons.functional.Pred<DataModelEnumValue> matchName(String name)
           
static com.ca.commons.functional.Pred<DataModelEnumValue> matchOrdinal(int ordinal)
           
static com.ca.commons.functional.Fn<DataModelEnumValue,String> toName()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 to
representsNone - Does this enum value represent absence of attribute value this value.
Method Detail

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