Class DittoJsonSerializable.ObjectValue
java.lang.Object
com.ditto.java.serialization.DittoJsonSerializable
com.ditto.java.serialization.DittoJsonSerializable.ObjectValue
- Enclosing class:
DittoJsonSerializable
Represents a JSON object value.
JSON objects are key-value mappings where keys are strings and values are JSON-serializable.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ditto.java.serialization.DittoJsonSerializable
DittoJsonSerializable.ArrayValue, DittoJsonSerializable.NullValue, DittoJsonSerializable.ObjectValue, DittoJsonSerializable.PrimitiveValue, DittoJsonSerializable.StringValue -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull com.ditto.internal.serialization.InternalDittoJsonSerializable.ObjectValueReturns the internal JSON serializable implementation.booleanisEmpty()Checks if this JSON object is empty.toMap()Converts this JSON object to a plainMap<String, Object>.
-
Method Details
-
getImplementation
protected @NonNull com.ditto.internal.serialization.InternalDittoJsonSerializable.ObjectValue getImplementation()Description copied from class:DittoJsonSerializableReturns the internal JSON serializable implementation.- Overrides:
getImplementationin classDittoJsonSerializable- Returns:
- the internal implementation.
-
isEmpty
public boolean isEmpty()Checks if this JSON object is empty.- Returns:
trueif the object contains no entries,falseotherwise.
-
toMap
Converts this JSON object to a plain
Map<String, Object>.Each value is recursively converted: strings become
String, numbers becomeInteger,Long, orDouble, booleans becomeBoolean, nulls becomenull, arrays becomeList<Object>, and nested objects becomeMap<String, Object>.- Returns:
- a plain Java map representation of this JSON object.
-