Class DataListHolder<DATA,SELECTOR>
- java.lang.Object
-
- org.openmuc.jeebus.spine.spi.function.DataListHolder<DATA,SELECTOR>
-
- Type Parameters:
DATA- The type of data elements in the list.
public class DataListHolder<DATA,SELECTOR> extends java.lang.ObjectHolder class that encapsulates access to the list of DATA objects used forReadListFeatureFunctionandReadAndWriteListFeatureFunction. Implements many of the operations that just need to access the list and manipulate its data.Methods on this class perform no validation or notification. However, they take functional interfaces as parameters, and/or return lists of notifications, so that the feature functions can hook in validation and notification properly.
-
-
Constructor Summary
Constructors Constructor Description DataListHolder(ListFeatureFunctionTypeInfo<DATA,?,SELECTOR,?> typeInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<DATA>getDataCopies(java.util.List<java.lang.Integer> idxList)java.util.List<DATA>getDataCopiesFor(java.util.function.Predicate<DATA> predicate)Returns a list of data copies for data that matches given conditionDATAgetDataCopy(int idx)Get a copy of the list entry at a specified index.DATAgetDataCopyForFirst(java.util.function.Predicate<DATA> predicate)Returns a copy of the first found data for the given condition.java.util.List<DATA>getFullCopy()
-
-
-
Field Detail
-
dataList
protected final java.util.List<DATA> dataList
-
-
Constructor Detail
-
DataListHolder
public DataListHolder(ListFeatureFunctionTypeInfo<DATA,?,SELECTOR,?> typeInfo)
-
-
Method Detail
-
getDataCopy
public DATA getDataCopy(int idx)
Get a copy of the list entry at a specified index.- Parameters:
idx- The index to copy from- Returns:
- (a copy of) the entry at the given index.
-
getDataCopyForFirst
public DATA getDataCopyForFirst(java.util.function.Predicate<DATA> predicate)
Returns a copy of the first found data for the given condition.- Parameters:
predicate- the condition- Returns:
- copy of the first found data, null if none is found
-
getDataCopiesFor
public java.util.List<DATA> getDataCopiesFor(java.util.function.Predicate<DATA> predicate)
Returns a list of data copies for data that matches given condition- Parameters:
predicate- the condition- Returns:
- list of data copies
-
getDataCopies
public java.util.List<DATA> getDataCopies(java.util.List<java.lang.Integer> idxList)
-
getFullCopy
public java.util.List<DATA> getFullCopy()
-
-