- Type Parameters:
T- the value type
- All Superinterfaces:
Consumer<List<T>>,EventObserver<List<T>>,Iterable<T>,Supplier<List<T>>,Value<List<T>>,ValueObserver<List<T>>,Values<T,,List<T>> ValuesObserver<T,List<T>>
An observable wrapper for a List of values, including possible null values.
A factory for
ValueList instances.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface is.codion.common.value.Value
Value.Notify, Value.Validator<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueList.Builder<T>builder()Creates a newValueList.Builderinstance.static <T> ValueList.Builder<T>builder(Collection<T> initialValue) Creates a newValueList.Builderinstance.observer()Returns aValuesObservernotified each time this value changes.static <T> ValueList<T>Creates a new emptyValueList, usingValue.Notify.WHEN_CHANGED.static <T> ValueList<T>valueList(Collection<T> initialValue) Creates a newValueList, usingValue.Notify.WHEN_CHANGED.Methods inherited from interface is.codion.common.event.EventObserver
addConsumer, addListener, addWeakConsumer, addWeakListener, removeConsumer, removeListener, removeWeakConsumer, removeWeakListenerMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface is.codion.common.value.Value
accept, addValidator, clear, link, link, map, mapNull, removeValidator, set, unlink, unlink, validateMethods inherited from interface is.codion.common.value.ValueObserver
isEqualTo, isNotEqualTo, isNotNull, isNull, isNullable, optionalMethods inherited from interface is.codion.common.value.Values
add, addAll, addAll, remove, removeAll, removeAll, set, valueMethods inherited from interface is.codion.common.value.ValuesObserver
contains, containsAll, empty, notEmpty, size
-
Method Details
-
observer
ValueListObserver<T> observer()Description copied from interface:ValuesReturns aValuesObservernotified each time this value changes. -
valueList
Creates a new emptyValueList, usingValue.Notify.WHEN_CHANGED.- Type Parameters:
T- the value type- Returns:
- a new
ValueList
-
valueList
Creates a newValueList, usingValue.Notify.WHEN_CHANGED.- Type Parameters:
T- the value type- Parameters:
initialValue- the initial value, may not be null- Returns:
- a new
ValueList
-
builder
Creates a newValueList.Builderinstance.- Type Parameters:
T- the value set type- Returns:
- a new builder
-
builder
Creates a newValueList.Builderinstance.- Type Parameters:
T- the value set type- Parameters:
initialValue- the initial value- Returns:
- a new builder
- Throws:
NullPointerException- in caseinitialValueis null
-