Class DittoJsonSerializable.ObjectValue

java.lang.Object
com.ditto.java.serialization.DittoJsonSerializable
com.ditto.java.serialization.DittoJsonSerializable.ObjectValue
Enclosing class:
DittoJsonSerializable

public static final class DittoJsonSerializable.ObjectValue extends DittoJsonSerializable

Represents a JSON object value.

JSON objects are key-value mappings where keys are strings and values are JSON-serializable.

  • Method Details

    • getImplementation

      protected @NonNull com.ditto.internal.serialization.InternalDittoJsonSerializable.ObjectValue getImplementation()
      Description copied from class: DittoJsonSerializable
      Returns the internal JSON serializable implementation.
      Overrides:
      getImplementation in class DittoJsonSerializable
      Returns:
      the internal implementation.
    • isEmpty

      public boolean isEmpty()
      Checks if this JSON object is empty.
      Returns:
      true if the object contains no entries, false otherwise.
    • toMap

      public @NonNull Map<@NonNull String,@Nullable Object> toMap()

      Converts this JSON object to a plain Map<String, Object>.

      Each value is recursively converted: strings become String, numbers become Integer, Long, or Double, booleans become Boolean, nulls become null, arrays become List<Object>, and nested objects become Map<String, Object>.

      Returns:
      a plain Java map representation of this JSON object.