Class ReportingRpcUtils
java.lang.Object
com.inductiveautomation.reporting.common.util.ReportingRpcUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
deserializeFromTypedElement
(com.inductiveautomation.ignition.common.gson.JsonElement element, com.inductiveautomation.ignition.common.gson.Gson context, Class<T> clazz) Method is used to deserialize an object that was serialized usingserializeToTypedElement(Object, Gson)
.static <T> T
deserializeFromTypedElement
(com.inductiveautomation.ignition.common.gson.JsonElement element, com.inductiveautomation.ignition.common.gson.JsonDeserializationContext context, Class<T> clazz) Method is used to deserialize an object that was serialized usingserializeToTypedElement(Object, JsonSerializationContext)
.static com.inductiveautomation.ignition.common.gson.JsonElement
serializeToTypedElement
(Object object, com.inductiveautomation.ignition.common.gson.Gson gson) For objects that are subclasses of a common type, erasure can cause issues when deserializing.static com.inductiveautomation.ignition.common.gson.JsonElement
serializeToTypedElement
(Object object, com.inductiveautomation.ignition.common.gson.JsonSerializationContext context) For objects that are subclasses of a common type, erasure can cause issues when deserializing.
-
Method Details
-
serializeToTypedElement
public static com.inductiveautomation.ignition.common.gson.JsonElement serializeToTypedElement(Object object, com.inductiveautomation.ignition.common.gson.Gson gson) For objects that are subclasses of a common type, erasure can cause issues when deserializing. This method preserves the type of the object when serializing, so that it can be deserialized correctly usingdeserializeFromTypedElement(JsonElement, Gson, Class)
.- Parameters:
object
- The object to serializegson
- To use for serialization- Returns:
- A JsonElement that contains the serialized object
-
deserializeFromTypedElement
public static <T> T deserializeFromTypedElement(com.inductiveautomation.ignition.common.gson.JsonElement element, com.inductiveautomation.ignition.common.gson.Gson context, Class<T> clazz) Method is used to deserialize an object that was serialized usingserializeToTypedElement(Object, Gson)
. See that method of an explanation of the context of usage. -
serializeToTypedElement
public static com.inductiveautomation.ignition.common.gson.JsonElement serializeToTypedElement(Object object, com.inductiveautomation.ignition.common.gson.JsonSerializationContext context) For objects that are subclasses of a common type, erasure can cause issues when deserializing. This method preserves the type of the object when serializing, so that it can be deserialized correctly usingdeserializeFromTypedElement(JsonElement, JsonDeserializationContext, Class)
.- Parameters:
object
- The object to serializecontext
- The serialization context- Returns:
- A JsonElement that contains the serialized object
-
deserializeFromTypedElement
public static <T> T deserializeFromTypedElement(com.inductiveautomation.ignition.common.gson.JsonElement element, com.inductiveautomation.ignition.common.gson.JsonDeserializationContext context, Class<T> clazz) Method is used to deserialize an object that was serialized usingserializeToTypedElement(Object, JsonSerializationContext)
. See that method of an explanation of the context of usage.
-