public class SnmpInt32 extends java.lang.Object implements SnmpSyntax, java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static byte |
ASNTYPE
The ASN.1 type as defined by the SNMP SMI
specification.
|
private int |
m_value
The internal 32-bit signed quantity
|
(package private) static long |
serialVersionUID
Added for serialization support
|
Constructor and Description |
---|
SnmpInt32()
Default constructor.
|
SnmpInt32(int value)
Constructs a SnmpInt32 object with the passed value.
|
SnmpInt32(java.lang.Integer value)
Constructs a SnmpInt32 object with the specified value.
|
SnmpInt32(SnmpInt32 second)
Class copy constructor.
|
SnmpInt32(java.lang.String value)
Simple class constructor that attempts to parse the passed string
into a valid integer value.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Returns a duplicate of the current object.
|
int |
decodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Used to decode the integer value from the ASN.1 buffer.
|
SnmpSyntax |
duplicate()
Returns a duplicate of the current object.
|
int |
encodeASN(byte[] buf,
int offset,
AsnEncoder encoder)
Used to encode the integer value into an ASN.1 buffer.
|
int |
getValue()
Used to access the internal 32-bit signed quantity.
|
void |
setValue(int value)
Used to set the 32-bit signed quantity
|
void |
setValue(java.lang.Integer value)
Used to set the 32-bit signed quantity
|
java.lang.String |
toString()
Returns the string representation of the object.
|
byte |
typeId()
Used to retreive the ASN.1 type for this object.
|
private int m_value
static final long serialVersionUID
public static final byte ASNTYPE
public SnmpInt32()
public SnmpInt32(int value)
value
- The 32-bit signed integer value for the object.public SnmpInt32(java.lang.Integer value)
value
- An Integer object containing the 32-bte value.public SnmpInt32(SnmpInt32 second)
second
- The object to get the value from.public SnmpInt32(java.lang.String value)
value
- The integer value represented as a Stringjava.lang.NumberFormatException
- Thrown if the passed value
cannot be turned into a valid integer.java.lang.NullPointerException
- Thrown if the passed string
is a null reference.public int getValue()
public void setValue(int value)
value
- The new value for the object.public void setValue(java.lang.Integer 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
- The location to write the encoded dataoffset
- The start of the encoded buffer.encoder
- The ASN.1 encoder objectAsnEncodingException
- Thrown if an encoding error occurspublic int decodeASN(byte[] buf, int offset, AsnEncoder encoder) throws AsnDecodingException
decodeASN
in interface SnmpSyntax
buf
- The encoded ASN.1 dataoffset
- The offset of the first byte of dataencoder
- The ASN.1 decoder 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.