Class VariableBindingMapperJava

All Implemented Interfaces:
VariableBindingMapper<Long,BigInteger,String,GregorianCalendar,byte[]>

public class VariableBindingMapperJava extends AbstractVariableBindingMapper<Long,BigInteger,String,GregorianCalendar,byte[]>
VariableBindingMapperJava maps SNMP4J VariableBinding variables to Java native language objects and vice versa.
Version:
1.0
Author:
Frank Fock
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.snmp4j.smi.VariableBinding
    fromBinary(org.snmp4j.smi.OID oid, byte[] binaryValue)
    Create a SNMP4J variable binding for an OID and a binary string value.
    org.snmp4j.smi.VariableBinding
    fromDate(org.snmp4j.smi.OID oid, GregorianCalendar dateValue)
    Create a SNMP4J variable binding for an OID and a date value.
    org.snmp4j.smi.VariableBinding
    fromLong(org.snmp4j.smi.OID oid, Long 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, String stringValue)
    Create a SNMP4J variable binding for an OID and a string value.
    org.snmp4j.smi.VariableBinding
    fromUnsignedLong(org.snmp4j.smi.OID oid, BigInteger unsignedLongValue)
    Create a SNMP4J variable binding for an OID and an unsigned long value.
    byte[]
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • VariableBindingMapperJava

      public VariableBindingMapperJava()
  • Method Details

    • toLong

      public Long toLong(org.snmp4j.smi.VariableBinding variableBinding)
      Description copied from interface: VariableBindingMapper
      Convert the provided variable binding to a long value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a long value.
    • toUnsignedLong

      public BigInteger toUnsignedLong(org.snmp4j.smi.VariableBinding variableBinding)
      Description copied from interface: VariableBindingMapper
      Convert the provided variable binding to an unsigned long value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      an unsigned long.
    • toString

      public String toString(org.snmp4j.smi.VariableBinding variableBinding)
      Description copied from interface: VariableBindingMapper
      Convert the provided variable binding to a string value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a string value.
    • toDate

      public GregorianCalendar toDate(org.snmp4j.smi.VariableBinding variableBinding)
      Description copied from interface: VariableBindingMapper
      Convert the provided variable binding to a date value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a date value.
    • toBinary

      public byte[] toBinary(org.snmp4j.smi.VariableBinding variableBinding)
      Description copied from interface: VariableBindingMapper
      Convert the provided variable binding to a binary value.
      Parameters:
      variableBinding - a SNMP4J variable binding.
      Returns:
      a binary value.
    • toObject

      public Object toObject(org.snmp4j.smi.VariableBinding variableBinding, Class targetClass)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromLong(org.snmp4j.smi.OID oid, Long longValue)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromUnsignedLong(org.snmp4j.smi.OID oid, BigInteger unsignedLongValue)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromString(org.snmp4j.smi.OID oid, String stringValue)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromDate(org.snmp4j.smi.OID oid, GregorianCalendar dateValue)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromBinary(org.snmp4j.smi.OID oid, byte[] binaryValue)
      Description copied from interface: VariableBindingMapper
      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

      public org.snmp4j.smi.VariableBinding fromObject(org.snmp4j.smi.OID oid, Object object)
      Description copied from interface: VariableBindingMapper
      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.