Class DefaultFlavorContainer<T extends PersistentData>
java.lang.Object
com.inductiveautomation.ignition.gateway.storeforward.flavor.DefaultFlavorContainer<T>
- Type Parameters:
T- a subclass ofPersistentDatathat is relevant to this flavor container
- All Implemented Interfaces:
FlavorContainer<T>,PersistentFlavor<T>
public final class DefaultFlavorContainer<T extends PersistentData>
extends Object
implements FlavorContainer<T>
A default implementation of the
FlavorContainer interface that stores a set of flavors.
The container itself is a PersistentFlavor.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFlavorContainer(String signature, LocalizedString description, PersistentSerializer<T, ?> serializer, @Nullable SystemIdentifier systemType) Creates a new default flavor container with the given signature, description, serializer, and optional system type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFlavor(PersistentFlavor<? extends T> flavor) Adds aPersistentFlavorto this container.Collection<PersistentFlavor<? extends T>>Returns the data linked to thisPersistentFlavor.static <T extends PersistentData>
DefaultFlavorContainer<T>createWithFlavors(String signature, LocalizedString description, SystemIdentifier systemType, Class<T> type, PersistentFlavor<? extends T>... flavors) Creates a newDefaultFlavorContainerwith the given flavors.Returns theTPersistentDataclass that this flavor is associated with.Returns a localized description of this flavor.booleaninthashCode()voidremoveFlavor(PersistentFlavor<? extends T> flavor) Removes aPersistentFlavorfrom this container.Returns a serializer suitable for this flavor.Returns a unique signature for this flavor.Returns the system type identifier for this flavor, if available.toString()
-
Constructor Details
-
DefaultFlavorContainer
public DefaultFlavorContainer(String signature, LocalizedString description, PersistentSerializer<T, ?> serializer, @Nullable SystemIdentifier systemType) Creates a new default flavor container with the given signature, description, serializer, and optional system type.- Parameters:
signature- The signature of this container.description- A localized description of this container.serializer- The serializer used to serialize / deserialize data belonging to this flavor.systemType- The system type associated with this container, or null if none is specified.
-
-
Method Details
-
signature
Description copied from interface:PersistentFlavorReturns a unique signature for this flavor.- Specified by:
signaturein interfacePersistentFlavor<T extends PersistentData>- Returns:
- a String representing the flavor's signature
-
description
Description copied from interface:PersistentFlavorReturns a localized description of this flavor.- Specified by:
descriptionin interfacePersistentFlavor<T extends PersistentData>- Returns:
- a LocalizedString providing a description
-
serializer
Description copied from interface:PersistentFlavorReturns a serializer suitable for this flavor.- Specified by:
serializerin interfacePersistentFlavor<T extends PersistentData>- Returns:
- a GenericDeserializer capable of handling T instances
-
systemType
Description copied from interface:PersistentFlavorReturns the system type identifier for this flavor, if available.- Specified by:
systemTypein interfacePersistentFlavor<T extends PersistentData>- Returns:
- an Optional containing the SystemIdentifier, or empty if not applicable
-
dataClass
Description copied from interface:PersistentFlavorReturns theTPersistentDataclass that this flavor is associated with.- Specified by:
dataClassin interfacePersistentFlavor<T extends PersistentData>- Returns:
- the
PersistentDataclass that is associated with this flavor
-
childFlavors
Returns the data linked to thisPersistentFlavor. In this case, the data is the set ofPersistentFlavors.- Specified by:
childFlavorsin interfaceFlavorContainer<T extends PersistentData>- Returns:
- The set of all flavors
-
addFlavor
Adds aPersistentFlavorto this container.- Parameters:
flavor- The flavor to be added
-
removeFlavor
Removes aPersistentFlavorfrom this container.- Parameters:
flavor- The flavor to be removed
-
createWithFlavors
@SafeVarargs public static <T extends PersistentData> DefaultFlavorContainer<T> createWithFlavors(String signature, LocalizedString description, SystemIdentifier systemType, Class<T> type, PersistentFlavor<? extends T>... flavors) Creates a newDefaultFlavorContainerwith the given flavors.- Type Parameters:
T- a subclass ofPersistentDatathat is relevant to this flavor container- Parameters:
signature- the signature of the containerdescription- the description of the containersystemType- the system identifier of the containertype- the class of the persistent data that can use this flavor containerflavors- the flavors to add to the container- Returns:
- a new
DefaultFlavorContainerwith the given flavors
-
equals
-
hashCode
public int hashCode() -
toString
-