Class CompositeScheduleModel
java.lang.Object
com.palantir.ptoss.cinch.core.DefaultBindableModel
com.inductiveautomation.ignition.common.user.schedule.AbstractScheduleModel
com.inductiveautomation.ignition.common.user.schedule.CompositeScheduleModel
- All Implemented Interfaces:
BindableModel
,Serializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
deserializeFromTypedArray
(com.inductiveautomation.ignition.common.gson.JsonArray array, com.inductiveautomation.ignition.common.gson.JsonDeserializationContext context, Class<T> clazz) Method is used to deserialize a list of objects that were serialized usingserializeToTypedArray(List, JsonSerializationContext)
.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)
.Returns a Timeline object with the day's schedule, or null if no schedule for the day.getType()
boolean
static <T> com.inductiveautomation.ignition.common.gson.JsonArray
serializeToTypedArray
(List<T> list, com.inductiveautomation.ignition.common.gson.JsonSerializationContext context) For lists that contain objects of different types, this method can be used to serialize the list, while preserving the type for deserialization.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.void
setObserveHolidays
(boolean observeHolidays) Methods inherited from class com.inductiveautomation.ignition.common.user.schedule.AbstractScheduleModel
equals, getDescription, getName, hashCode, setDescription, setName
Methods inherited from class com.palantir.ptoss.cinch.core.DefaultBindableModel
bind, modelUpdated, unbind, unbindAll, update
-
Field Details
-
COMPOSITE_SCHEDULE
- See Also:
-
-
Constructor Details
-
CompositeScheduleModel
-
-
Method Details
-
getType
- Specified by:
getType
in classAbstractScheduleModel
-
getScheduleForDay
Description copied from class:AbstractScheduleModel
Returns a Timeline object with the day's schedule, or null if no schedule for the day.- Specified by:
getScheduleForDay
in classAbstractScheduleModel
- Throws:
Exception
-
isObserveHolidays
public boolean isObserveHolidays()- Specified by:
isObserveHolidays
in classAbstractScheduleModel
-
setObserveHolidays
public void setObserveHolidays(boolean observeHolidays) - Specified by:
setObserveHolidays
in classAbstractScheduleModel
-
getModels
-
serializeToTypedArray
public static <T> com.inductiveautomation.ignition.common.gson.JsonArray serializeToTypedArray(List<T> list, com.inductiveautomation.ignition.common.gson.JsonSerializationContext context) For lists that contain objects of different types, this method can be used to serialize the list, while preserving the type for deserialization. Used in conjunction withdeserializeFromTypedArray(JsonArray, JsonDeserializationContext, Class)
. -
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
-
deserializeFromTypedArray
public static <T> List<T> deserializeFromTypedArray(com.inductiveautomation.ignition.common.gson.JsonArray array, com.inductiveautomation.ignition.common.gson.JsonDeserializationContext context, Class<T> clazz) Method is used to deserialize a list of objects that were serialized usingserializeToTypedArray(List, JsonSerializationContext)
. See that method for an explanation of the context of usage. -
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.
-