Package com.tailf.conf
Class ConfEnumeration
Object
com.tailf.conf.ConfObject
com.tailf.conf.ConfValue
com.tailf.conf.ConfEnumeration
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<ConfEnumeration>
public class ConfEnumeration
extends ConfValue
implements Cloneable, Serializable, Comparable<ConfEnumeration>
DATA_CONTAINER - Corresponds to the YANG Enumeration type.
- See Also:
-
Field Summary
Fields inherited from class com.tailf.conf.ConfObject
J_BINARY, J_BIT32, J_BIT64, J_BITBIG, J_BOOL, J_BUF, J_CDBBEGIN, J_DATE, J_DATETIME, J_DECIMAL64, J_DEFAULT, J_DOUBLE, J_DQUAD, J_DURATION, J_ENUMERATION, J_HEXSTR, J_IDENTITYREF, J_INSTANCE_IDENTIFIER, J_INT16, J_INT32, J_INT64, J_INT8, J_IPV4, J_IPV4_AND_PLEN, J_IPV4PREFIX, J_IPV6, J_IPV6_AND_PLEN, J_IPV6PREFIX, J_LIST, J_NOEXISTS, J_OBJECTREF, J_OID, J_PTR, J_QNAME, J_STR, J_SYMBOL, J_TIME, J_UINT16, J_UINT32, J_UINT64, J_UINT8, J_UNION, J_XMLBEGIN, J_XMLBEGINDEL, J_XMLEND, J_XMLMOVEAFTER, J_XMLMOVEFIRST, J_XMLTAG
-
Constructor Summary
ConstructorDescriptionConfEnumeration
(int ordinalValue) Constructor for ordinalvalue.ConfEnumeration
(int ordinalValue, ArrayList<ConfNamespace> ns_list) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionint
encode()
encode value.boolean
Determine if two ConfValue are equal.static ConfEnumeration
getEnumByLabel
(ConfPath path, String label) Get an ConfEnumeration from the string label at a given position in the schema.static ConfEnumeration
getEnumByLabel
(String path, String label) Get an ConfEnumeration from the string label at a given position in the schema.static String
getLabelByEnum
(ConfPath path, ConfEnumeration e) Get the string label of an enumeration at a given position in the schema.static String
getLabelByEnum
(String path, ConfEnumeration e) Get the string label of an enumeration at a given position in the schema.int
Get the ordinal value (integer value) for this enumeration.int
hashCode()
Java object hash code for this object instancevoid
setCSType
(MaapiSchemas.CSType csType) The MaapiSchemas type for this enum.toString()
Get the string value for this enumeration.Methods inherited from class com.tailf.conf.ConfValue
getStringByValue, getStringByValue, getValueByString, getValueByString
Methods inherited from class com.tailf.conf.ConfObject
clone, decode
-
Constructor Details
-
ConfEnumeration
- Throws:
ConfException
-
ConfEnumeration
@Deprecated public ConfEnumeration(int ordinalValue, ArrayList<ConfNamespace> ns_list) throws ConfException Deprecated.Obsolete, Use ConfEnumeration(int ordinalValue) instead- Parameters:
ordinalValue
-ns_list
-- Throws:
ConfException
-
ConfEnumeration
Constructor for ordinalvalue.- Parameters:
ordinalValue
-- Throws:
ConfException
-
-
Method Details
-
setCSType
The MaapiSchemas type for this enum. The Schema type is used to be able to get the correct label for a specific ordinal value.- Parameters:
csType
- MaapiSchemas.CsType
-
equals
Description copied from class:ConfValue
Determine if two ConfValue are equal. In general, ConfObjects are equal if the components they consist of are equal. -
hashCode
public int hashCode()Java object hash code for this object instance -
getOrdinalValue
public int getOrdinalValue()Get the ordinal value (integer value) for this enumeration.- Returns:
- the ordinalValue
-
toString
Get the string value for this enumeration. This is the string label of the enumeration if and only if the MaapiSchemas type for this enumeration is know i.e. set using the setCSType() method. Otherwise it will be a representation of the ordinal value e.g "Enum(0)". -
encode
Description copied from class:ConfValue
encode value. -
compareTo
- Specified by:
compareTo
in interfaceComparable<ConfEnumeration>
-
getLabelByEnum
Get the string label of an enumeration at a given position in the schema. The given path must be absolute and fully qualified with schema prefixes. Note, this method relies on Maapi.loadSchemas() being called prior to this call.- Parameters:
path
- ConfPath pointing to the position of Enumeration in the schema.e
- ConfEnumeration containing ordinal value- Returns:
- String label for the ordinal value
- Throws:
ConfException
-
getLabelByEnum
Get the string label of an enumeration at a given position in the schema. The given path must be absolute and fully qualified with schema prefixes. Note, this method relies on Maapi.loadSchemas() being called prior to this call.- Parameters:
path
- String pathe
- ConfEnumeration containing ordinal value- Returns:
- String label for the ordinal value
- Throws:
ConfException
-
getEnumByLabel
Get an ConfEnumeration from the string label at a given position in the schema. The given path must be absolute and fully qualified with schema prefixes. Note, this method relies on Maapi.loadSchemas() being called prior to this call.- Parameters:
path
- ConfPath pointing to the position of Enumeration in the schema.label
- String label for enum value- Returns:
- ConfEnumeration for the label
- Throws:
ConfException
-
getEnumByLabel
Get an ConfEnumeration from the string label at a given position in the schema. The given path must be absolute and fully qualified with schema prefixes. Note, this method relies on Maapi.loadSchemas() being called prior to this call.- Parameters:
path
- String pointing to the position of Enumeration in the schema.label
- String label for enum value- Returns:
- ConfEnumeration for the label
- Throws:
ConfException
-