Interface IModelInstanceCollectionInfo<ITEM>
- All Known Implementing Classes:
AbstractModelInstanceCollectionInfo
public interface IModelInstanceCollectionInfo<ITEM>
-
Method Summary
Modifier and TypeMethodDescriptiondeepCopyItems(IBoundObject fromObject, IBoundObject toObject) Get the associated instance binding for which this info is for.default Collection<? extends ITEM>getItemsFromParentInstance(Object parentInstance) Collection<? extends ITEM>getItemsFromValue(Object value) Get the type of the bound object.booleanDetermine if the value is empty.static <T> IModelInstanceCollectionInfo<T>of(IBoundInstanceModel<T> instance) readItems(IModelInstanceReadHandler<ITEM> handler) Read the value data for the model instance.intGet the number of items associated with the value.voidwriteItems(IModelInstanceWriteHandler<ITEM> handler, Object value)
-
Method Details
-
of
-
getInstance
Get the associated instance binding for which this info is for.- Returns:
- the instance binding
-
size
Get the number of items associated with the value.- Parameters:
value- the value to identify items for- Returns:
- the number of items, which will be
0if value isnull
-
isEmpty
Determine if the value is empty.- Parameters:
value- the value representing a collection- Returns:
trueif the value represents a collection with no items orfalseotherwise
-
getItemType
Get the type of the bound object.- Returns:
- the raw type of the bound object
-
getItemsFromParentInstance
@NonNull default Collection<? extends ITEM> getItemsFromParentInstance(@NonNull Object parentInstance) -
getItemsFromValue
-
emptyValue
-
deepCopyItems
Object deepCopyItems(@NonNull IBoundObject fromObject, @NonNull IBoundObject toObject) throws BindingException - Throws:
BindingException
-
readItems
Read the value data for the model instance.This method will return a value based on the instance's value type.
- Parameters:
handler- the item parsing handler- Returns:
- the item collection object or
nullif the instance is not defined - Throws:
IOException- if there was an error when reading the data
-
writeItems
void writeItems(@NonNull IModelInstanceWriteHandler<ITEM> handler, @NonNull Object value) throws IOException - Throws:
IOException
-