Class JsonUtil

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

public class JsonUtil extends Object
Provides JSONP to/from JSONB conversions. Not efficient, but simple and portable for now. A more efficient implementation should avoid serialization.
  • Field Details

    • JSON_BUILDER_FACTORY

      public static final JsonBuilderFactory JSON_BUILDER_FACTORY
      Global JSON builder factory used by JSON-RPC implementation.
  • Method Details

    • jsonbToJsonp

      public static JsonObject jsonbToJsonp(Object object)
      Convert a JSONB instance into a JSONP instance.
      Parameters:
      object - the object
      Returns:
      the JSON value
    • jsonpToJsonb

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