-
Method Summary
static com.inductiveautomation.ignition.common.gson.Gson
buildGson(Consumer<com.inductiveautomation.ignition.common.gson.GsonBuilder> builderConsumer)
Builds a GSON instance with the ImmutableBytes adapter and the RFC 2339 date format set, along with
optional customizations.
decodeFromJson(com.inductiveautomation.ignition.common.gson.JsonElement json)
Similar to
decode(Resource)
, but decodes the resource's config from a JSON element.
Similar to
decode(Resource)
, but reads the resource's config from a reader which will
contain the JSON data of the encoded config object.
com.inductiveautomation.ignition.common.gson.JsonElement
Converts a resource config object instance to a JSON representation.
-
Method Details
-
encodeToJson
com.inductiveautomation.ignition.common.gson.JsonElement encodeToJson(R config)
Converts a resource config object instance to a JSON representation.
- Parameters:
config
- The resource to convert.
- Returns:
- A JSON representation of the resource.
-
-
decodeFromJson
Similar to
decode(Resource)
, but reads the resource's config from a reader which will
contain the JSON data of the encoded config object.
- Throws:
DecodingException
-
decode
- Specified by:
decode
in interface ResourceCodec<R>
- Parameters:
resource
- the resource to decode.
- Returns:
- the decoded resource.
- Throws:
DecodingException
- if the resource cannot be decoded.
- See Also:
-
-
buildGson
static com.inductiveautomation.ignition.common.gson.Gson buildGson(@Nullable
Consumer<com.inductiveautomation.ignition.common.gson.GsonBuilder> builderConsumer)
Builds a GSON instance with the ImmutableBytes adapter and the RFC 2339 date format set, along with
optional customizations.