L
- the model type for signed long values.U
- the model type for unsigned long values.S
- the model type for string values.D
- the model type for date (DateAndTime) values.B
- the model type for binary values (OCTET STRING, BITS).AbstractVariableBindingMapper
, VariableBindingMapperJava
public interface VariableBindingMapper<L,U,S,D,B>
VariableBindingMapper
interface provides conversion methods
to convert VariableBinding
instances to and from signed long,
unsigned long, string, date and time, and binary values.Modifier and Type | Method | Description |
---|---|---|
org.snmp4j.smi.VariableBinding |
fromBinary(org.snmp4j.smi.OID oid,
B binaryValue) |
Create a SNMP4J variable binding for an
OID and a binary string value. |
org.snmp4j.smi.VariableBinding |
fromDate(org.snmp4j.smi.OID oid,
D dateValue) |
Create a SNMP4J variable binding for an
OID and a date value. |
org.snmp4j.smi.VariableBinding |
fromLong(org.snmp4j.smi.OID oid,
L longValue) |
Create a SNMP4J variable binding for an
OID and a long value. |
org.snmp4j.smi.VariableBinding |
fromObject(org.snmp4j.smi.OID oid,
Object object) |
Create a SNMP4J variable binding for an
OID and an object value. |
org.snmp4j.smi.VariableBinding |
fromString(org.snmp4j.smi.OID oid,
S stringValue) |
Create a SNMP4J variable binding for an
OID and a string value. |
org.snmp4j.smi.VariableBinding |
fromUnsignedLong(org.snmp4j.smi.OID oid,
U unsignedLongValue) |
Create a SNMP4J variable binding for an
OID and an unsigned long value. |
B |
toBinary(org.snmp4j.smi.VariableBinding variableBinding) |
Convert the provided variable binding to a binary value.
|
D |
toDate(org.snmp4j.smi.VariableBinding variableBinding) |
Convert the provided variable binding to a date value.
|
L |
toLong(org.snmp4j.smi.VariableBinding variableBinding) |
Convert the provided variable binding to a long value.
|
Object |
toObject(org.snmp4j.smi.VariableBinding variableBinding,
Class targetClass) |
Convert the provided variable binding to a value of the specified class.
|
S |
toString(org.snmp4j.smi.VariableBinding variableBinding) |
Convert the provided variable binding to a string value.
|
U |
toUnsignedLong(org.snmp4j.smi.VariableBinding variableBinding) |
Convert the provided variable binding to an unsigned long value.
|
L toLong(org.snmp4j.smi.VariableBinding variableBinding)
variableBinding
- a SNMP4J variable binding.U toUnsignedLong(org.snmp4j.smi.VariableBinding variableBinding)
variableBinding
- a SNMP4J variable binding.S toString(org.snmp4j.smi.VariableBinding variableBinding)
variableBinding
- a SNMP4J variable binding.D toDate(org.snmp4j.smi.VariableBinding variableBinding)
variableBinding
- a SNMP4J variable binding.B toBinary(org.snmp4j.smi.VariableBinding variableBinding)
variableBinding
- a SNMP4J variable binding.Object toObject(org.snmp4j.smi.VariableBinding variableBinding, Class targetClass)
variableBinding
- the SNMP4J variable binding to convert (no modification of the object itself).targetClass
- the class of the return type.targetClass
with the converted value of
variableBinding
or null
if the conversion failed.org.snmp4j.smi.VariableBinding fromLong(org.snmp4j.smi.OID oid, L longValue)
OID
and a long value.oid
- an OID.longValue
- a numeric long value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified long value,
null
will be returned if the conversion failed.org.snmp4j.smi.VariableBinding fromUnsignedLong(org.snmp4j.smi.OID oid, U unsignedLongValue)
OID
and an unsigned long value.oid
- an OID.unsignedLongValue
- a numeric unsigned long value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified unsigned long value,
null
will be returned if the conversion failed.org.snmp4j.smi.VariableBinding fromString(org.snmp4j.smi.OID oid, S stringValue)
OID
and a string value.oid
- an OID.stringValue
- a numeric long value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified string value,
null
will be returned if the conversion failed.org.snmp4j.smi.VariableBinding fromDate(org.snmp4j.smi.OID oid, D dateValue)
OID
and a date value.oid
- an OID.dateValue
- a string value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified date value,
null
will be returned if the conversion failed.org.snmp4j.smi.VariableBinding fromBinary(org.snmp4j.smi.OID oid, B binaryValue)
OID
and a binary string value.oid
- an OID.binaryValue
- a binary string value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified binary value,
null
will be returned if the conversion failed.org.snmp4j.smi.VariableBinding fromObject(org.snmp4j.smi.OID oid, Object object)
OID
and an object value.oid
- an OID.object
- an object value.VariableBinding
instance with the OID
oid
and variable
that matches the SNMP type defined for that OID with the specified object value,
null
will be returned if the conversion failed.Copyright © 2020 SNMP4J.org. All rights reserved.