Record Class PersistentDataBundle<T extends PersistentData>
java.lang.Object
java.lang.Record
com.inductiveautomation.ignition.gateway.storeforward.data.PersistentDataBundle<T>
- Type Parameters:
T
- type of PersistentData elements- Record Components:
storageId
- identifies the target storage destinationdata
- the list of PersistentData to be stored
- All Implemented Interfaces:
PersistentData
public record PersistentDataBundle<T extends PersistentData>(StorageId storageId, List<T extends PersistentData> data)
extends Record
implements PersistentData
Associates PersistentData with a specific storage destination within an engine.
This wrapper enables explicit routing of data to specific storage sinks
when multiple sinks of the same flavor exist within an engine.
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentDataBundle
(StorageId storageId, List<T> data) Constructs a new PersistentDataBundle instance with validation. -
Method Summary
Modifier and TypeMethodDescriptiondata()
Returns the value of thedata
record component.final boolean
Indicates whether some other object is "equal to" this one.int
Returns the count of data elements.@NotNull PersistentFlavor<T>
Retrieves thePersistentFlavor
associated with this kind of persistent data.final int
hashCode()
Returns a hash code value for this object.static <T extends PersistentData>
PersistentDataBundle<T>Creates a new PersistentDataBundle instance with multiple data items.static <T extends PersistentData>
PersistentDataBundle<T>Creates a new PersistentDataBundle instance with multiple data items.static <T extends PersistentData>
PersistentDataBundle<T>Creates a new PersistentDataBundle instance from a list of PersistentData items.static <T extends PersistentData>
PersistentDataBundle<T>Creates a new PersistentDataBundle instance from a list of PersistentData items.Returns the value of thestorageId
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
PersistentDataBundle
Constructs a new PersistentDataBundle instance with validation.- Throws:
IllegalArgumentException
- if storageId is null or data is null/empty
-
-
Method Details
-
of
@SafeVarargs public static <T extends PersistentData> PersistentDataBundle<T> of(StorageId storageId, T... data) Creates a new PersistentDataBundle instance with multiple data items.- Type Parameters:
T
- type of PersistentData elements- Parameters:
storageId
- the storage destinationdata
- varargs of PersistentData items- Returns:
- new PersistentDataBundle instance
-
of
@SafeVarargs public static <T extends PersistentData> PersistentDataBundle<T> of(String engineId, T... data) Creates a new PersistentDataBundle instance with multiple data items.- Type Parameters:
T
- type of PersistentData elements- Parameters:
engineId
- the engine iddata
- varargs of PersistentData items- Returns:
- new PersistentDataBundle instance
-
ofList
public static <T extends PersistentData> PersistentDataBundle<T> ofList(StorageId storageId, List<T> dataList) Creates a new PersistentDataBundle instance from a list of PersistentData items.- Type Parameters:
T
- type of PersistentData elements- Parameters:
storageId
- the storage destinationdataList
- the list of PersistentData items to store- Returns:
- new PersistentDataBundle instance
- Throws:
IllegalArgumentException
- if dataList is null or empty
-
ofList
public static <T extends PersistentData> PersistentDataBundle<T> ofList(String engineId, List<T> dataList) Creates a new PersistentDataBundle instance from a list of PersistentData items.- Type Parameters:
T
- type of PersistentData elements- Parameters:
engineId
- the engine iddataList
- the list of PersistentData items to store- Returns:
- new PersistentDataBundle instance
- Throws:
IllegalArgumentException
- if dataList is null or empty
-
getFlavor
Description copied from interface:PersistentData
Retrieves thePersistentFlavor
associated with this kind of persistent data.- Specified by:
getFlavor
in interfacePersistentData
- Returns:
- a
PersistentFlavor
object
-
getDataCount
public int getDataCount()Description copied from interface:PersistentData
Returns the count of data elements. Default implementation assumes there's always at least one data element.- Specified by:
getDataCount
in interfacePersistentData
- Returns:
- the count of data elements
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
storageId
Returns the value of thestorageId
record component.- Returns:
- the value of the
storageId
record component
-
data
Returns the value of thedata
record component.- Returns:
- the value of the
data
record component
-