Class DittoJsonSerializable

java.lang.Object
com.ditto.java.serialization.DittoJsonSerializable
Direct Known Subclasses:
DittoJsonSerializable.ArrayValue, DittoJsonSerializable.NullValue, DittoJsonSerializable.ObjectValue, DittoJsonSerializable.PrimitiveValue, DittoJsonSerializable.StringValue

Represents a value that can be serialized to JSON format.

This class provides methods for creating and manipulating JSON-serializable values used by Ditto for document data. JSON serialization is simpler than CBOR and is commonly used for interoperability with web services and REST APIs.

Values can be created using the static factory methods:

- [#of(String)] - for string values
- [#of(Map)] - for JSON objects
- [#of(List)] - for JSON arrays
- [#of(boolean)], [#of(int)], [#of(long)], [#of(float)], [#of(double)] - for primitives
- [#nullValue()] - for null values

Values can be converted to Java types using the various get* methods, such as getBoolean(), getInt(), getDouble(), etc.