Interface VariableBindingMapper<L,U,S,D,B>

Type Parameters:
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).
All Known Implementing Classes:
AbstractVariableBindingMapper, VariableBindingMapperJava

public interface VariableBindingMapper<L,U,S,D,B>
This VariableBindingMapper interface provides conversion methods to convert VariableBinding instances to and from signed long, unsigned long, string, date and time, and binary values.
Version:
1.0
Author:
Frank Fock
  • Method Summary

    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.
    toBinary(org.snmp4j.smi.VariableBinding variableBinding)
    Convert the provided variable binding to a binary value.
    toDate(org.snmp4j.smi.VariableBinding variableBinding)
    Convert the provided variable binding to a date value.
    toLong(org.snmp4j.smi.VariableBinding variableBinding)
    Convert the provided variable binding to a long value.
    toObject(org.snmp4j.smi.VariableBinding variableBinding, Class targetClass)
    Convert the provided variable binding to a value of the specified class.
    toString(org.snmp4j.smi.VariableBinding variableBinding)
    Convert the provided variable binding to a string value.
    toUnsignedLong(org.snmp4j.smi.VariableBinding variableBinding)
    Convert the provided variable binding to an unsigned long value.
  • Method Details

    • toLong

      L toLong(org.snmp4j.smi.VariableBinding variableBinding)
      Convert the provided variable binding to a long value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a long value.
    • toUnsignedLong

      U toUnsignedLong(org.snmp4j.smi.VariableBinding variableBinding)
      Convert the provided variable binding to an unsigned long value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      an unsigned long.
    • toString

      S toString(org.snmp4j.smi.VariableBinding variableBinding)
      Convert the provided variable binding to a string value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a string value.
    • toDate

      D toDate(org.snmp4j.smi.VariableBinding variableBinding)
      Convert the provided variable binding to a date value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a date value.
    • toBinary

      B toBinary(org.snmp4j.smi.VariableBinding variableBinding)
      Convert the provided variable binding to a binary value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a binary value.
    • toObject

      Object toObject(org.snmp4j.smi.VariableBinding variableBinding, Class targetClass)
      Convert the provided variable binding to a value of the specified class.
      Parameters:
      variableBinding - the SNMP4J variable binding to convert (no modification of the object itself).
      targetClass - the class of the return type.
      Returns:
      an instance of targetClass with the converted value of variableBinding or null if the conversion failed.
    • fromLong

      org.snmp4j.smi.VariableBinding fromLong(org.snmp4j.smi.OID oid, L longValue)
      Create a SNMP4J variable binding for an OID and a long value.
      Parameters:
      oid - an OID.
      longValue - a numeric long value.
      Returns:
      a 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.
    • fromUnsignedLong

      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.
      Parameters:
      oid - an OID.
      unsignedLongValue - a numeric unsigned long value.
      Returns:
      a 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.
    • fromString

      org.snmp4j.smi.VariableBinding fromString(org.snmp4j.smi.OID oid, S stringValue)
      Create a SNMP4J variable binding for an OID and a string value.
      Parameters:
      oid - an OID.
      stringValue - a numeric long value.
      Returns:
      a 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.
    • fromDate

      org.snmp4j.smi.VariableBinding fromDate(org.snmp4j.smi.OID oid, D dateValue)
      Create a SNMP4J variable binding for an OID and a date value.
      Parameters:
      oid - an OID.
      dateValue - a string value.
      Returns:
      a 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.
    • fromBinary

      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.
      Parameters:
      oid - an OID.
      binaryValue - a binary string value.
      Returns:
      a 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.
    • fromObject

      org.snmp4j.smi.VariableBinding fromObject(org.snmp4j.smi.OID oid, Object object)
      Create a SNMP4J variable binding for an OID and an object value.
      Parameters:
      oid - an OID.
      object - an object value.
      Returns:
      a 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.