com.adventnet.snmp.snmp2
Class SnmpNull
java.lang.Object
|
+--com.adventnet.snmp.snmp2.SnmpVar
|
+--com.adventnet.snmp.snmp2.SnmpNull
- All Implemented Interfaces:
- java.io.Serializable
- public class SnmpNull
- extends SnmpVar
Class of SNMP Null Variable - Sub-class of SnmpVar.
This class can be used to created a SnmpVar object of type SnmpNull.
It also has methods to retrieve the value in different forms(eg. String,
byte). The SnmpNull type is used as a placeholder.
Additionally it can take up the error indication for a particular OID.
i.e SnmpAPI.NOSUCHOBJECTEXP, SnmpAPI.NOSUCHINSTANCEEXP,
or SnmpAPI.ENDOFMIBVIEWEXP.
- See Also:
- Serialized Form
Constructor Summary |
SnmpNull()
Creates an SnmpNull object with the value 0. |
SnmpNull(byte val)
Creates an SnmpNull object. |
Method Summary |
java.lang.Object |
getVarObject()
Returns the value of this SnmpNull object as an appropriate Object type,
in this case returns null. |
byte[] |
toBytes()
Returns the value of this SnmpNull object as null with return type
byte[]. |
java.lang.String |
toString()
Converts value of this SnmpNull object to a printable string. |
java.lang.String |
toTagString()
Converts the value of this SnmpNull object to a printable string
where the type is tagged before the value with the appropriate tag
Type. |
java.lang.Object |
toValue()
Returns the value of this SnmpNull object as an appropriate Object type,
in this case returns null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SnmpNull
public SnmpNull()
- Creates an SnmpNull object with the value 0.
SnmpNull
public SnmpNull(byte val)
- Creates an SnmpNull object. Null Objects in Snmpv2c
and Snmpv3 can take up additionally the error indication
for the particular oid.
- Parameters:
val
- could be any of SnmpAPI.NOSUCHOBJECTEXP ,
SnmpAPI.NOSUCHINSTANCEEXP,
or SnmpAPI.ENDOFMIBVIEWEXP.
getVarObject
public java.lang.Object getVarObject()
- Returns the value of this SnmpNull object as an appropriate Object type,
in this case returns null. This method is the same as toValue().
- Overrides:
getVarObject
in class SnmpVar
- Returns:
- the value of this SnmpNull object as a null value.
toValue
public java.lang.Object toValue()
- Returns the value of this SnmpNull object as an appropriate Object type,
in this case returns null.
- Overrides:
toValue
in class SnmpVar
- Returns:
- the value of this SnmpNull object as null value.
toString
public java.lang.String toString()
- Converts value of this SnmpNull object to a printable string.
Returns a string with value "NULL".
- Overrides:
toString
in class SnmpVar
- Returns:
- the value of this SnmpNull as a printable string as "NULL".
toTagString
public java.lang.String toTagString()
- Converts the value of this SnmpNull object to a printable string
where the type is tagged before the value with the appropriate tag
Type. The tag type can be any of the SnmpVar types(i.e STRING,
INTEGER, etc.).
- Overrides:
toTagString
in class SnmpVar
- Returns:
- the value of this SnmpNull object to a printable string
where the type is tagged before the value with the appropriate tag type.
toBytes
public byte[] toBytes()
- Returns the value of this SnmpNull object as null with return type
byte[].
- Overrides:
toBytes
in class SnmpVar
- Returns:
- the value of this SnmpNull object as null with return type
byte[].
Copyright (c)AdventNet Inc., 1996-2004