public class SnmpVarBind extends java.lang.Object implements SnmpSyntax, java.lang.Cloneable, java.io.Serializable
SnmpSyntax
,
SnmpPduPacket
,
Serialized FormModifier and Type | Field and Description |
---|---|
static byte |
ASNTYPE
The ASN.1 identifier used to mark SNMP variables
|
private SnmpObjectId |
m_name
The object identifier that uniquely identifies
the "value".
|
private SnmpSyntax |
m_value
The actual value object associated with the
object identifier.
|
(package private) static long |
serialVersionUID
Allows for evolution of serialization format.
|
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(java.lang.String name)
Constructs a new variable with the give name.
|
SnmpVarBind(java.lang.String name,
SnmpSyntax value)
Constructs a new variable with the passed name
and value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.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.
|
SnmpSyntax |
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(java.lang.String name)
Sets the variable's name to passed value.
|
void |
setValue(SnmpSyntax value)
Sets the value for the variable
|
java.lang.String |
toString()
Converts the object to a string representation
|
byte |
typeId()
Returns the ASN.1 type id for the object.
|
static final long serialVersionUID
private SnmpObjectId m_name
private SnmpSyntax m_value
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(java.lang.String name)
name
- Dotted decimal object identifier.SnmpObjectId
public SnmpVarBind(java.lang.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(java.lang.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 SnmpSyntax
public int encodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnEncodingException
encodeASN
in interface SnmpSyntax
buf
- Storeage for the encoded dataoffset
- Offset to start encoding dataencoder
- The encoder used to convert the dataAnsEncodingException
- Thrown if the encoder encounters
an error while building the buffer.AsnEncodingException
- Thrown if an encoding error occurspublic int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- Encoded ASN.1 dataoffset
- Offset to first byte of encoded dataencoder
- The encoder used to convert the dataAnsDecodingException
- Thrown if an error occurs while
attempting to decode the data. This exception will be
thrown byte encoder object.AsnDecodingException
- Thrown if an encoding error occurspublic SnmpSyntax duplicate()
duplicate
in interface SnmpSyntax
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Generated by iurt on 2015.