Package com.oorian.json
Interface Jsonable
- All Known Implementing Classes:
GeolocationOptions,SchemaArticle,SchemaBreadcrumbList,SchemaFAQPage,SchemaOffer,SchemaOrganization,SchemaSoftwareApplication,SchemaType,SchemaWebPage,SchemaWebSite
public interface Jsonable
Interface for objects that can be serialized to and from JSON.
Implement this interface to enable automatic JSON serialization and deserialization
of your data classes. Classes implementing Jsonable can be directly added to
JsonObject and JsonArray instances, which will automatically
call toJsonValue() during serialization.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidinitFromJson(Jsonable json) Initializes this object's state from another Jsonable object.voidinitFromJson(JsonValue json) Initializes this object's state from a parsed JSON value.default voidinitFromJson(String json) Initializes this object's state from a JSON string.default StringSerializes this object to a JSON string.Serializes this object to aJsonValue.
-
Method Details
-
initFromJson
Initializes this object's state from a parsed JSON value.- Parameters:
json- the parsed JSON value.
-
initFromJson
Initializes this object's state from a JSON string.- Parameters:
json- the JSON string to parse and initialize from.
-
initFromJson
Initializes this object's state from another Jsonable object.- Parameters:
json- the Jsonable object to initialize from.
-
toJsonValue
JsonValue toJsonValue()Serializes this object to aJsonValue.- Returns:
- the JSON representation of this object.
-
toJsonString
Serializes this object to a JSON string.- Returns:
- the JSON string representation.
-