Class SmiObjectJsonConverter

java.lang.Object
com.snmp4j.smi.util.json.SmiObjectJsonConverter

public class SmiObjectJsonConverter extends Object
Utility class for converting SmiObject instances and their sub-interfaces to JSON format.
Since:
2.0
Version:
2.0
Author:
Frank Fock
  • Method Details

    • toJson

      public static String toJson(SmiObject smiObject)
      Converts any SmiObject (or sub-interface) to a JSON string representation.
      Parameters:
      smiObject - the SmiObject to convert (can be any sub-interface)
      Returns:
      JSON string representation
    • toJsonArray

      public static String toJsonArray(Collection<? extends SmiObject> objects)
      Converts a collection of SmiObjects to a JSON array string.
      Parameters:
      objects - collection of SmiObject instances
      Returns:
      JSON array string