Class ConfHexList

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

public class ConfHexList extends ConfBinary implements Cloneable, Serializable
DATA_CONTAINER - Corresponds to the YANG tailf:hex-list type.

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

A hex-list is defined as:

  typedef hex-list {
    type string {
      pattern '(([0-9a-fA-F]){2}(:([0-9a-fA-F]){2})*)?';
    }
   }
 

When a instance of this type is encoded and send over the socket through MAAPI or CDB with the Maapi.setElem(int,com.tailf.conf.ConfObject, com.tailf.conf.ConfPath), CdbSession.setElem(com.tailf.conf.ConfValue, com.tailf.conf.ConfPath) method it will encode this value as a ConfBinary which has the effect that the corresponding getElem from MAAPI and CDB will return a ConfBinary instead of a ConfHexList.

See Also:
  • Constructor Details

    • ConfHexList

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

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

      public ConfHexList(ConfBinary obj)
      Constructs a ConfHexList from a ConfBinary object.
      Parameters:
      obj - a ConfBinary object
  • Method Details

    • toString

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

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

      Overrides:
      toString in class ConfBinary
      Returns:
      a string representation of this ConfHexList
    • 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.
      Overrides:
      equals in class ConfBinary
      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 ConfHexList holds.
      Overrides:
      hashCode in class ConfBinary
      Returns:
      a hash code value for this object.