Module org.snmp4j

Interface OIDTextFormat

All Known Implementing Classes:
DictionaryOIDTextFormat, SimpleOIDTextFormat

public interface OIDTextFormat
The OIDTextFormat provides a textual representation of a raw object ID.
Since:
1.10
Version:
2.2
Author:
Frank Fock
  • Method Summary

    Modifier and Type
    Method
    Description
    format(int[] value)
    Returns a textual representation of a raw object ID, for example as dotted string ("1.3.6.1.4") or object name ("ifDescr") depending on the formats representation rules.
    formatForRoundTrip(int[] value)
    Returns a textual representation of a raw object ID, for example as dotted string ("1.3.6.1.4"), object name plus numerical index ("ifDescr.0"), or other formats that can be parsed again with parse(String) to a the same OID value.
    int[]
    parse(String text)
    Parses a textual representation of an object ID and returns its raw value.
  • Method Details

    • format

      String format(int[] value)
      Returns a textual representation of a raw object ID, for example as dotted string ("1.3.6.1.4") or object name ("ifDescr") depending on the formats representation rules.
      Parameters:
      value - the OID value to format.
      Returns:
      the textual representation.
    • formatForRoundTrip

      String formatForRoundTrip(int[] value)
      Returns a textual representation of a raw object ID, for example as dotted string ("1.3.6.1.4"), object name plus numerical index ("ifDescr.0"), or other formats that can be parsed again with parse(String) to a the same OID value.
      Parameters:
      value - the OID value to format.
      Returns:
      the textual representation.
    • parse

      int[] parse(String text) throws ParseException
      Parses a textual representation of an object ID and returns its raw value.
      Parameters:
      text - a textual representation of an OID.
      Returns:
      the raw OID value
      Throws:
      ParseException - if the OID cannot be parsed successfully.