Class SerializedObjectBuilder
java.lang.Object
com.inductiveautomation.perspective.common.SerializedObjectBuilder
Helper class that helps gson serializers make JsonObject instances and avoid serializing null fields where
omitting them would make for a cleaner serialized object.
-
Constructor Summary
ConstructorsConstructorDescriptionSerializedObjectBuilder
(com.inductiveautomation.ignition.common.gson.JsonSerializationContext context) -
Method Summary
Modifier and TypeMethodDescriptionAdd the boolean if it is not null and not equal to its default value.Add the integer value if it is not null.Add the integer value if it is not null and not equal to its default value.Add the given value if it is not null.Add the given value if it is not null and not equal to the provided default.Add the string value if it is not null.Add the string value if it is not null and not equal to its default value.add
(String fieldName, Collection<?> collection) Adds the given collection only if it is non-null and non-emptyAdd the given value if it is not null and it passes the given predicate.com.inductiveautomation.ignition.common.gson.JsonObject
build()
-
Constructor Details
-
SerializedObjectBuilder
public SerializedObjectBuilder(com.inductiveautomation.ignition.common.gson.JsonSerializationContext context)
-
-
Method Details
-
add
Add the given value if it is not null and it passes the given predicate. -
add
Add the string value if it is not null. -
add
Add the string value if it is not null and not equal to its default value. -
add
Add the boolean if it is not null and not equal to its default value. -
add
Add the integer value if it is not null and not equal to its default value. -
add
Add the integer value if it is not null. -
add
Add the given value if it is not null. -
add
Add the given value if it is not null and not equal to the provided default. -
add
Adds the given collection only if it is non-null and non-empty -
build
public com.inductiveautomation.ignition.common.gson.JsonObject build()
-