VariableBindingMapper<L,U,S,D,B>VariableBindingMapperJavapublic abstract class AbstractVariableBindingMapper<L,U,S,D,B> extends Object implements VariableBindingMapper<L,U,S,D,B>
AbstractVariableBindingMapper provides helper functions to support the
conversion between Variable values and native values used in an application.| Constructor | Description |
|---|---|
AbstractVariableBindingMapper() |
| Modifier and Type | Method | Description |
|---|---|---|
static String |
formatLong(Long value,
String displayHint) |
Format a Long value as a string according to the given DISPLAY-HINT format.
|
static String |
formatString(org.snmp4j.smi.OctetString value,
String displayHint) |
Formats an
OctetString value using a DISPLAY-HINT format to a String value. |
static GregorianCalendar |
makeCalendar(org.snmp4j.smi.OctetString dateAndTimeValue) |
Creates a
GregorianCalendar from a properly formatted
DateAndTime OctetString. |
static org.snmp4j.smi.OctetString |
makeDateAndTime(GregorianCalendar dateAndTime) |
Creates a DateAndTime
OctetString value from a
GregorianCalendar. |
static Long |
scanLong(String format,
String value) |
Scans a String value as a Long using the specified SMIv2 DISPLAY-HINT format specification.
|
static org.snmp4j.smi.OctetString |
scanString(String format,
String value) |
Scans a String representation of an
OctetString using a DISPLAY-HINT format. |
static int |
validateDateAndTime(org.snmp4j.smi.Variable dateAndTime) |
Tests a variable for DateAndTime conformance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromBinary, fromDate, fromLong, fromObject, fromString, fromUnsignedLong, toBinary, toDate, toLong, toObject, toString, toUnsignedLongpublic static String formatLong(Long value, String displayHint)
value - the long value to formatdisplayHint - the format description as defined by SMIv2 for integer values.public static String formatString(org.snmp4j.smi.OctetString value, String displayHint)
OctetString value using a DISPLAY-HINT format to a String value.value - an OctetString instance.displayHint - a SMIv2 DISPLAY-HINT string format specification.value.public static org.snmp4j.smi.OctetString scanString(String format, String value)
OctetString using a DISPLAY-HINT format.format - the SMIv2 DISPLAY-HINT format.value - a String representation of an OctetString that matches the given format.OctetString representation of the given value.public static Long scanLong(String format, String value) throws NumberFormatException
format - the SMIv2 DISPLAY-HINT format.value - a string value representing a number with the DISPLAY-HINT format.null if the value could not by
scanned using the given format.NumberFormatException - if value and format render a string that cannot be parsed as a long value.public static org.snmp4j.smi.OctetString makeDateAndTime(GregorianCalendar dateAndTime)
OctetString value from a
GregorianCalendar.dateAndTime - a GregorianCalendar instance.OctetString instance with the set calendar value.public static GregorianCalendar makeCalendar(org.snmp4j.smi.OctetString dateAndTimeValue)
GregorianCalendar from a properly formatted
DateAndTime OctetString.dateAndTimeValue - an OctetString conforming to the DateAndTime TC.GregorianCalendar instance.public static int validateDateAndTime(org.snmp4j.smi.Variable dateAndTime)
dateAndTime - a Variable.SnmpConstants.SNMP_ERROR_SUCCESS if dateAndTime
is valid or an appropriate SNMP error code if not.Copyright © 2020 SNMP4J.org. All rights reserved.