Class JsonValue

java.lang.Object
com.couchbase.client.java.json.JsonValue
Direct Known Subclasses:
JsonArray, JsonNull, JsonObject

public abstract class JsonValue extends Object
Represents a JSON value (either a JsonObject or a JsonArray.
Since:
2.0
  • Field Details

    • NULL

      public static final JsonNull NULL
      Represents a Json "null".
  • Constructor Details

    • JsonValue

      public JsonValue()
  • Method Details

    • jo

      public static JsonObject jo()
      Static factory method to create an empty JsonObject.
      Returns:
      an empty JsonObject.
    • ja

      public static JsonArray ja()
      Static factory method to create an empty JsonArray.
      Returns:
      an empty JsonArray.
    • checkType

      public static boolean checkType(Object item)
      Helper method to check if the given item is a supported JSON item.
      Parameters:
      item - the value to check.
      Returns:
      true if supported, false otherwise.
    • coerce

      @Internal public static Object coerce(Object value)
      Returns the given value converted to a type that passes the checkType(java.lang.Object) test.
      Throws:
      com.couchbase.client.core.error.InvalidArgumentException - if conversion is not possible.