Interface IPropertyCollector
-
public interface IPropertyCollector
The class is used to "collect" items together to assign to the property's field. For fields with a collection type, implementations of this class will handle managing the underlying collection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Object item)
Add an item to the "collection", who's type depends on the property configuration.void
addAll(Collection<?> items)
Add a collection of item to the "collection", who's type depends on the property configuration.Object
getValue()
Get the current state of the "collection".
-
-
-
Method Detail
-
add
void add(@NonNull Object item)
Add an item to the "collection", who's type depends on the property configuration.- Parameters:
item
- the item to add- Throws:
IllegalStateException
- if the item cannot be added due to a model inconsistency
-
addAll
void addAll(@NonNull Collection<?> items)
Add a collection of item to the "collection", who's type depends on the property configuration.- Parameters:
items
- the items to add- Throws:
IllegalStateException
- if the item cannot be added due to a model inconsistency
-
getValue
Object getValue()
Get the current state of the "collection". For single valued "non-collections" this may return anull
value. For any collection type, such asList
orMap
, this must return a non-null
empty collection.- Returns:
- the "collection" value or
null
for a single valued instance that is not defined
-
-