Class ConfHexString

All Implemented Interfaces:
Serializable, Cloneable, Comparable<ConfHexString>

public class ConfHexString extends ConfValue implements Cloneable, Serializable, Comparable<ConfHexString>
DATA_CONTAINER - Corresponds to the YANG hex-string type.

A string of colon-separated hexa-decimal octets e.g. '4F:4C:41:71'.

A hex-list is defined as:

  hex-string {
     type string {
      pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
    }
  }
 
A hexadecimal string with octets represented as hex digits separated by colons. The canonical representation uses lowercase characters.
See Also:
  • Constructor Details

    • ConfHexString

      public ConfHexString(String str) throws ConfException
      Construct a ConfHexString from a string of bytes in the format of hexadecimal values separated with colons.
      Parameters:
      str - string representation of the ConfHexString
      Throws:
      ConfException
    • ConfHexString

      public ConfHexString(byte[] val)
      Construct a ConfHexString from a byte array.
      Parameters:
      val - byte array representation of the ConfHexString
    • ConfHexString

      public ConfHexString(ConfBinary obj)
      Constructs a ConfHexString from a ConfBinary object.
      Parameters:
      obj - a ConfBinary object
    • ConfHexString

      public ConfHexString(ConfEObject o) throws ConfException
      Throws:
      ConfException
  • Method Details

    • toString

      public String toString()
      Returns string representation of a ConfHexString.

      Format a HexString as hexadecimal values separated with colons, as for example: "00:4f:4c:41:ff".

      Specified by:
      toString in class ConfValue
      Returns:
      a string representation of this ConfHexString
    • 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()
      Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.Hashtable. The hash code is calculated through the list of bytes that this ConfHexString holds.
      Specified by:
      hashCode in class ConfValue
      Returns:
      a hash code value for this object.
    • encode

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

      public int compareTo(ConfHexString o)
      Specified by:
      compareTo in interface Comparable<ConfHexString>