com.h3c.util.snmp

## Class VarBinds

- java.lang.Object
- - com.h3c.util.snmp.VarBinds

- Direct Known Subclasses:
    SnmpPdu, SnmpPduTrapV1

      public class VarBinds
      extends Object

  This class implements common variable binding methods used by the PDU classes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VarBinds()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addOid(SnmpOid oid)` Add VarBind of type NULL.
    `void` | `addOid(String oid)` Add VarBind of type NULL.
    `void` | `addVB_64(SnmpOid oid, long value)` Add VarBind of type COUNTER64.
    `void` | `addVB_64(String oid, long value)` Add VarBind of type COUNTER64.
    `void` | `addVB_U32(SnmpOid oid, long value)` Add VarBind of type COUNTER32.
    `void` | `addVB_U32(String oid, long value)` Add VarBind of type COUNTER32.
    `void` | `addVB(SnmpOid oid, byte[] value)` Add VarBind of type OCTET_STR.
    `void` | `addVB(SnmpOid oid, int value)` Add VarBind of type INTEGER.
    `void` | `addVB(SnmpOid oid, IpAddress value)` Add VarBind of type IP_ADDRESS.
    `void` | `addVB(SnmpOid oid, SnmpField value)` Add VarBind using the passed in object.
    `void` | `addVB(SnmpOid oid, SnmpOid value)` Add VarBind of type OID.
    `void` | `addVB(SnmpOid oid, String value)` Add VarBind of type OCTET_STR.
    `void` | `addVB(String oid, byte[] value)` Add VarBind of type OCTET_STR.
    `void` | `addVB(String oid, int value)` Add VarBind of type INTEGER.
    `void` | `addVB(String oid, IpAddress value)` Add VarBind of type IP_ADDRESS.
    `void` | `addVB(String oid, SnmpField value)` Add VarBind using the passed in object.
    `void` | `addVB(String oid, SnmpOid value)` Add VarBind of type OID.
    `void` | `addVB(String oid, String value)` Add VarBind of type OCTET_STR.
    `void` | `clearVBs()` Cleans out the VarBinds.
    `int` | `getNumVBs()` Returns the number of variable bindings, or 0 if the reference object has not been set
    `SnmpField` | `getOid(int i)` Returns the OID at the specified index or null.
    `SnmpField` | `getVal(int i)` Returns the value at the specified index or null.
    `SnmpField` | `getVB(int i)` Returns the variable binding at the specified index or null.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### VarBinds

          public VarBinds()

  - ### Method Detail

    - #### getNumVBs

          public int getNumVBs()

      Returns the number of variable bindings, or 0 if the reference object has not been set
      Returns:
        number of variable bindings

    - #### getVB

          public SnmpField getVB(int i)

      Returns the variable binding at the specified index or null.
      Parameters:
        `i` - variable binding index
      Returns:
        variable binding field

    - #### getOid

          public SnmpField getOid(int i)

      Returns the OID at the specified index or null.
      Parameters:
        `i` - variable binding index
      Returns:
        OID field

    - #### getVal

          public SnmpField getVal(int i)

      Returns the value at the specified index or null.
      Parameters:
        `i` - variable binding index
      Returns:
        value field

    - #### addVB

          public void addVB(SnmpOid oid,
                   SnmpField value)

      Add VarBind using the passed in object.
      Parameters:
        `oid` - OID
        `value` - field object

    - #### addVB

          public void addVB(String oid,
                   SnmpField value)

      Add VarBind using the passed in object.
      Parameters:
        `oid` - OID string value
        `value` - field object

    - #### addVB

          public void addVB(SnmpOid oid,
                   int value)

      Add VarBind of type INTEGER.
      Parameters:
        `oid` - OID
        `value` - integer value

    - #### addVB

          public void addVB(String oid,
                   int value)

      Add VarBind of type INTEGER.
      Parameters:
        `oid` - OID string value
        `value` - integer value

    - #### addVB_U32

          public void addVB_U32(SnmpOid oid,
                       long value)

      Add VarBind of type COUNTER32.
      Parameters:
        `oid` - OID
        `value` - long value

    - #### addVB_U32

          public void addVB_U32(String oid,
                       long value)

      Add VarBind of type COUNTER32.
      Parameters:
        `oid` - OID string value
        `value` - long value

    - #### addVB_64

          public void addVB_64(SnmpOid oid,
                      long value)

      Add VarBind of type COUNTER64.
      Parameters:
        `oid` - OID
        `value` - long value

    - #### addVB_64

          public void addVB_64(String oid,
                      long value)

      Add VarBind of type COUNTER64.
      Parameters:
        `oid` - OID string value
        `value` - long value

    - #### addVB

          public void addVB(SnmpOid oid,
                   String value)

      Add VarBind of type OCTET_STR.
      Parameters:
        `oid` - OID
        `value` - string value

    - #### addVB

          public void addVB(String oid,
                   String value)

      Add VarBind of type OCTET_STR.
      Parameters:
        `oid` - OID string value
        `value` - string value

    - #### addVB

          public void addVB(SnmpOid oid,
                   byte[] value)

      Add VarBind of type OCTET_STR.
      Parameters:
        `oid` - OID
        `value` - byte array value

    - #### addVB

          public void addVB(String oid,
                   byte[] value)

      Add VarBind of type OCTET_STR.
      Parameters:
        `oid` - OID string value
        `value` - byte array value

    - #### addVB

          public void addVB(SnmpOid oid,
                   IpAddress value)

      Add VarBind of type IP_ADDRESS.
      Parameters:
        `oid` - OID
        `value` - IP address value

    - #### addVB

          public void addVB(String oid,
                   IpAddress value)

      Add VarBind of type IP_ADDRESS.
      Parameters:
        `oid` - OID string value
        `value` - IP address value

    - #### addVB

          public void addVB(SnmpOid oid,
                   SnmpOid value)

      Add VarBind of type OID.
      Parameters:
        `oid` - OID
        `value` - IP address value

    - #### addVB

          public void addVB(String oid,
                   SnmpOid value)

      Add VarBind of type OID.
      Parameters:
        `oid` - OID string value
        `value` - IP address value

    - #### addOid

          public void addOid(SnmpOid oid)

      Add VarBind of type NULL.
      Parameters:
        `oid` - OID string value

    - #### addOid

          public void addOid(String oid)

      Add VarBind of type NULL.
      Parameters:
        `oid` - OID string value

    - #### clearVBs

          public void clearVBs()

      Cleans out the VarBinds.

Copyright © 2014. All Rights Reserved.