Class JsonUtil

java.lang.Object
io.helidon.jsonrpc.core.JsonUtil

public class JsonUtil extends Object
Provides JSON binding helpers used by JSON-RPC types.
  • Method Details

    • toJsonObject

      public static JsonObject toJsonObject(Object object)
      Convert a bound Java object into a JSON object.
      Parameters:
      object - the object
      Returns:
      the JSON object
    • fromJson

      public static <T> T fromJson(JsonValue value, Class<T> type)
      Convert a JSON value into a Java object.
      Type Parameters:
      T - the type of the instance
      Parameters:
      value - the JSON value
      type - the target type
      Returns:
      the Java instance
    • fromJson

      public static <T> T fromJson(JsonObject object, Class<T> type)
      Convert a JSON object into a Java object.
      Type Parameters:
      T - the type of the instance
      Parameters:
      object - the JSON object
      type - the target type
      Returns:
      the Java instance