public class SnmpInt32 extends Object implements SnmpSyntax, Cloneable, Serializable
| Modifier and Type | Field and Description |
|---|---|
static byte |
ASNTYPE
The ASN.1 type as defined by the SNMP SMI specification.
|
| Constructor and Description |
|---|
SnmpInt32()
Default constructor.
|
SnmpInt32(int value)
Constructs a SnmpInt32 object with the passed value.
|
SnmpInt32(Integer value)
Constructs a SnmpInt32 object with the specified value.
|
SnmpInt32(SnmpInt32 second)
Class copy constructor.
|
SnmpInt32(String value)
Simple class constructor that attempts to parse the passed string into a
valid integer value.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
boolean |
equals(Object obj) |
int |
getValue()
Used to access the internal 32-bit signed quantity.
|
int |
hashCode() |
void |
setValue(int value)
Used to set the 32-bit signed quantity
|
void |
setValue(Integer value)
Used to set the 32-bit signed quantity
|
static Integer |
toInteger(SnmpInt32 val) |
String |
toString()
Returns the string representation of the object.
|
byte |
typeId()
Used to retreive the ASN.1 type for this object.
|
public static final byte ASNTYPE
public SnmpInt32()
public SnmpInt32(int value)
value - The 32-bit signed integer value for the object.public SnmpInt32(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(String value)
value - The integer value represented as a StringNumberFormatException - Thrown if the passed value cannot be turned into a valid
integer.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(Integer 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 - 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 SnmpSyntaxbuf - 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 SnmpSyntaxpublic Object clone()
public String toString()
Copyright © 2018. All rights reserved.