# Class BERNode

java.lang.Object
com.snmp4j.smi.ber.BERNode

Direct Known Subclasses:
  `BERNodeError`

public class BERNode extends Object
A node in the BER parse tree of an SNMP message. Each node represents one TLV (tag-length-value) element decoded from the raw bytes.

Since:
  2.0.0
Author:
  Frank Fock

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable)`
  Creates a new BER node.
  `BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable, String description)`
  Creates a new BER node with a description.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addChild(BERNode child)`
  `List<BERNode>`
  `getChildren()`
  `org.snmp4j.smi.Variable`
  `getData()`
  `String`
  `getDescription()`
  `List<Integer>`
  `getExpectedTags()`
  `String`
  `getFormattedValue()`
  `org.snmp4j.smi.OID`
  `getOid()`
  `int`
  `getPos()`
  `int`
  `getSequenceLength()`
  `int`
  `getTag()`
  `String`
  `getTagHex()`
  Returns the hex representation of the BER tag of this BER node.
  `String`
  `getTagName()`
  Returns the name of the BER tag of this BER node.
  `int`
  `getTotalLength()`
  `boolean`
  `isDecrypted()`
  `void`
  `setDecrypted(boolean decrypted)`
  `void`
  `setDescription(String description)`
  `void`
  `setExpectedTags(LinkedList<?> expectedTags)`
  Sets the list of expected tags for this BER node.
  `void`
  `setFormattedValue(String formattedValue)`
  `void`
  `setOid(org.snmp4j.smi.OID oid)`
  `void`
  `setSequenceLength(int sequenceLength)`
  `String`
  `toString()`
  Returns a multi-line string representation of this BER node.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BERNode

    public BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable)
    Creates a new BER node.
    Parameters:
      `tag` - the BER tag value
      `position` - the position of the BER node in the raw bytes
      `totalLength` - the total length of the BER node in the raw bytes
      `variable` - the variable decoded from the BER node

  - ### BERNode

    public BERNode(int tag, int position, int totalLength, org.snmp4j.smi.Variable variable, String description)
    Creates a new BER node with a description.
    Parameters:
      `tag` - the BER tag value
      `position` - the position of the BER node in the raw bytes
      `totalLength` - the total length of the BER node in the raw bytes
      `variable` - the variable decoded from the BER node
      `description` - the description of the BER node

- ## Method Details

  - ### getTag

    public int getTag()

  - ### getPos

    public int getPos()

  - ### getTotalLength

    public int getTotalLength()

  - ### getSequenceLength

    public int getSequenceLength()

  - ### getDescription

    public String getDescription()

  - ### getFormattedValue

    public String getFormattedValue()

  - ### getOid

    public org.snmp4j.smi.OID getOid()

  - ### getData

    public org.snmp4j.smi.Variable getData()

  - ### isDecrypted

    public boolean isDecrypted()

  - ### getChildren

    public List<BERNode> getChildren()

  - ### getExpectedTags

    public List<Integer> getExpectedTags()

  - ### setSequenceLength

    public void setSequenceLength(int sequenceLength)

  - ### setDescription

    public void setDescription(String description)

  - ### setFormattedValue

    public void setFormattedValue(String formattedValue)

  - ### setOid

    public void setOid(org.snmp4j.smi.OID oid)

  - ### setDecrypted

    public void setDecrypted(boolean decrypted)

  - ### setExpectedTags

    public void setExpectedTags(LinkedList<?> expectedTags)
    Sets the list of expected tags for this BER node.
    Parameters:
      `expectedTags` - a list of expected tags.

  - ### addChild

    public void addChild(BERNode child)

  - ### getTagHex

    public String getTagHex()
    Returns the hex representation of the BER tag of this BER node.
    Returns:
      the hex representation of the BER tag of this BER node.

  - ### getTagName

    public String getTagName()
    Returns the name of the BER tag of this BER node.
    Returns:
      the name of the BER tag of this BER node.

  - ### toString

    public String toString()
    Returns a multi-line string representation of this BER node.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this BER node.