public class SnmpVarBind extends Object implements SnmpSyntax, Cloneable, Serializable
SnmpSyntax, 
SnmpPduPacket, 
Serialized Form| Modifier and Type | Field and Description | 
|---|---|
static byte | 
ASNTYPE
The ASN.1 identifier used to mark SNMP variables 
 | 
| Constructor and Description | 
|---|
SnmpVarBind()
The default class constructor. 
 | 
SnmpVarBind(SnmpObjectId name)
Constructs a specific variable with the "name" equal to the passed object
 identifier. 
 | 
SnmpVarBind(SnmpObjectId name,
           SnmpSyntax value)
Constructs a variable with the passed name and value. 
 | 
SnmpVarBind(SnmpVarBind second)
Class copy constructor. 
 | 
SnmpVarBind(String name)
Constructs a new variable with the give name. 
 | 
SnmpVarBind(String name,
           SnmpSyntax value)
Constructs a new variable with the passed name and value. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
Object | 
clone()
Returns a newly created duplicate object to the caller 
 | 
int | 
decodeASN(byte[] buf,
         int offset,
         AsnEncoder encoder)
Used to recover the encoded variable data from the passed ASN.1 buffer. 
 | 
SnmpVarBind | 
duplicate()
Returns a newly created duplicate object to the caller 
 | 
int | 
encodeASN(byte[] buf,
         int offset,
         AsnEncoder encoder)
Encodes the SnmpVarBind object into the passed buffer. 
 | 
SnmpObjectId | 
getName()
Returns the object identifier that names the variable. 
 | 
SnmpSyntax | 
getValue()
Retreives the variable's value. 
 | 
void | 
setName(SnmpObjectId name)
Sets the variable's object identifier name. 
 | 
void | 
setName(String name)
Sets the variable's name to passed value. 
 | 
void | 
setValue(SnmpSyntax value)
Sets the value for the variable 
 | 
String | 
toString()
Converts the object to a string representation 
 | 
byte | 
typeId()
Returns the ASN.1 type id for the object. 
 | 
public static final byte ASNTYPE
public SnmpVarBind()
public SnmpVarBind(SnmpObjectId name)
name - The object identifer name for this variable.public SnmpVarBind(SnmpObjectId name, SnmpSyntax value)
name - The object identifier namevalue - The syntax object.public SnmpVarBind(String name)
name - Dotted decimal object identifier.SnmpObjectIdpublic SnmpVarBind(String name, SnmpSyntax value)
name - The dotted decimal object identifer namevalue - The SnmpSyntax value for the variablepublic SnmpVarBind(SnmpVarBind second)
second - The variable to copypublic SnmpObjectId getName()
public void setName(SnmpObjectId name)
name - The new object id for the variable.public void setName(String name)
name - The dotted decimal object identifier.public SnmpSyntax getValue()
public void setValue(SnmpSyntax value)
value - The new value for the objectpublic byte typeId()
typeId in interface SnmpSyntaxpublic int encodeASN(byte[] buf,
                     int offset,
                     AsnEncoder encoder)
              throws AsnEncodingException
encodeASN in interface SnmpSyntaxbuf - Storeage for the encoded dataoffset - Offset to start encoding dataencoder - The encoder used to convert the dataAsnEncodingException - Thrown if the encoder encounters an error while building
                the buffer.public int decodeASN(byte[] buf,
                     int offset,
                     AsnEncoder encoder)
              throws AsnDecodingException
decodeASN in interface SnmpSyntaxbuf - Encoded ASN.1 dataoffset - Offset to first byte of encoded dataencoder - The encoder used to convert the dataAsnDecodingException - Thrown if an error occurs while attempting to decode the
                data. This exception will be thrown byte encoder object.public SnmpVarBind duplicate()
duplicate in interface SnmpSyntaxpublic Object clone()
Copyright © 2020. All rights reserved.