Class 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:
  • Constructor Details

  • Method Details

    • setCSType

      public void setCSType(MaapiSchemas.CSType csType)
      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

      public boolean equals(Object o)
      Description copied from class: ConfValue
      Determine if two ConfValue are equal. In general, ConfObjects are equal if the components they consist of are equal.
      Specified by:
      equals in class ConfValue
      Parameters:
      o - The object to compare to.
      Returns:
      true if the objects are identical.
    • hashCode

      public int hashCode()
      Java object hash code for this object instance
      Specified by:
      hashCode in class ConfValue
    • getOrdinalValue

      public int getOrdinalValue()
      Get the ordinal value (integer value) for this enumeration.
      Returns:
      the ordinalValue
    • toString

      public String 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)".
      Specified by:
      toString in class ConfValue
      Returns:
      the printable representation of the object.
    • encode

      public ConfEObject encode()
      Description copied from class: ConfValue
      encode value.
      Specified by:
      encode in class ConfValue
    • compareTo

      public int compareTo(ConfEnumeration o)
      Specified by:
      compareTo in interface Comparable<ConfEnumeration>
    • getLabelByEnum

      public static String getLabelByEnum(ConfPath path, ConfEnumeration e) throws ConfException
      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

      public static String getLabelByEnum(String path, ConfEnumeration e) throws ConfException
      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 path
      e - ConfEnumeration containing ordinal value
      Returns:
      String label for the ordinal value
      Throws:
      ConfException
    • getEnumByLabel

      public static ConfEnumeration getEnumByLabel(ConfPath path, String label) throws ConfException
      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

      public static ConfEnumeration getEnumByLabel(String path, String label) throws ConfException
      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