MySnmpCrawler API

snmp.message.datatype
Class MySnmpCrawlerInt32

java.lang.Object
  |
  +--org.opennms.protocols.snmp.SnmpInt32
        |
        +--snmp.message.datatype.MySnmpCrawlerInt32
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, SnmpDatatype, org.opennms.protocols.snmp.SnmpSyntax

public class MySnmpCrawlerInt32
extends org.opennms.protocols.snmp.SnmpInt32
implements SnmpDatatype

Represents INTEGER (Int32).

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:50 $
Author:
Scott Cheng
See Also:
Serialized Form

Field Summary
static java.lang.Class expectType
           
static java.lang.String javaDataType
           
 
Fields inherited from class org.opennms.protocols.snmp.SnmpInt32
ASNTYPE
 
Constructor Summary
MySnmpCrawlerInt32()
          The default Constructor.
MySnmpCrawlerInt32(java.lang.Integer value)
          Constructs a SnmpInt32 object with the Integer object.
MySnmpCrawlerInt32(MySnmpCrawlerInt32 second)
          The copy Constructor constructs the MySnmpCrawlerInt32 object that is identical to the passed object.
 
Method Summary
 java.lang.Object clone()
          Creates a new object that is a duplicate of the current object.
 org.opennms.protocols.snmp.SnmpSyntax duplicate()
          Creates a new object that is a duplicate of the current object.
 java.lang.String getJavaDataType()
          Gets the string description of the expected java datatype.
 java.lang.Object getJavaDataValue()
          Gets the Java object value corresponding to the the SnmpSyntax object.
 boolean isValidJavaDatatype(java.lang.Class c)
          Checks to see if the exptected Class type equals to the passed Class object.
 boolean isValidJavaDatatype(java.lang.Object o)
          Checks if the expected datatype of the Java object value matches to the passed Java object value.
 void setSnmpDataValue(java.lang.Object o)
          Sets the Java object value into the SnmpSyntax object.
static boolean validateJavaDatatype(java.lang.Object o)
          Validates the Java object value with the expected datatype.
 
Methods inherited from class org.opennms.protocols.snmp.SnmpInt32
decodeASN, encodeASN, getValue, setValue, setValue, toString, typeId
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opennms.protocols.snmp.SnmpSyntax
decodeASN, encodeASN, typeId
 

Field Detail

javaDataType

public static final java.lang.String javaDataType
See Also:
Constant Field Values

expectType

public static java.lang.Class expectType
Constructor Detail

MySnmpCrawlerInt32

public MySnmpCrawlerInt32()
The default Constructor.


MySnmpCrawlerInt32

public MySnmpCrawlerInt32(java.lang.Integer value)
Constructs a SnmpInt32 object with the Integer object.

Parameters:
value - The Integer object containing the 32-bte value.

MySnmpCrawlerInt32

public MySnmpCrawlerInt32(MySnmpCrawlerInt32 second)
The copy Constructor constructs the MySnmpCrawlerInt32 object that is identical to the passed object.

Parameters:
second - The object to be copied from.
Method Detail

setSnmpDataValue

public void setSnmpDataValue(java.lang.Object o)
                      throws SnmpException
Sets the Java object value into the SnmpSyntax object.

Specified by:
setSnmpDataValue in interface SnmpDatatype
Parameters:
o - The Java object value.
Throws:
SnmpException - Thrown when the Java object value does not match to the expected datatype in the SnmpSyntax object.

getJavaDataValue

public java.lang.Object getJavaDataValue()
                                  throws SnmpException
Gets the Java object value corresponding to the the SnmpSyntax object.

Specified by:
getJavaDataValue in interface SnmpDatatype
Returns:
The Java object value corresponding to the the SnmpSyntax object.
Throws:
SnmpException - Thrown when any error occurs during converting the SnmpSyntax value to the Java object.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Object o)
Checks if the expected datatype of the Java object value matches to the passed Java object value.

Specified by:
isValidJavaDatatype in interface SnmpDatatype
Parameters:
o - The Java object value.
Returns:
True if matched to the expected type, otherwise false.

isValidJavaDatatype

public boolean isValidJavaDatatype(java.lang.Class c)
Checks to see if the exptected Class type equals to the passed Class object.

Specified by:
isValidJavaDatatype in interface SnmpDatatype
Parameters:
c - The Class object to be checked.
Returns:
True if they are the same, otherwise false.

clone

public java.lang.Object clone()
Creates a new object that is a duplicate of the current object.

Overrides:
clone in class org.opennms.protocols.snmp.SnmpInt32
Returns:
The newly created duplicate object.

duplicate

public org.opennms.protocols.snmp.SnmpSyntax duplicate()
Creates a new object that is a duplicate of the current object.

Specified by:
duplicate in interface org.opennms.protocols.snmp.SnmpSyntax
Overrides:
duplicate in class org.opennms.protocols.snmp.SnmpInt32
Returns:
The newly created duplicate object.

getJavaDataType

public java.lang.String getJavaDataType()
Gets the string description of the expected java datatype.

Specified by:
getJavaDataType in interface SnmpDatatype
Returns:
The string description of the expected java datatype.

validateJavaDatatype

public static boolean validateJavaDatatype(java.lang.Object o)
Validates the Java object value with the expected datatype.

Returns:
True if matched to the expected type, otherwise false.

MySnmpCrawler API