- Type Parameters:
T- the value type
- All Superinterfaces:
Iterable<T>,Observable<List<T>>,ObservableValueCollection<T,,List<T>> Observer<List<T>>,Value<List<T>>,ValueCollection<T,List<T>>
An observable wrapper for a List of values.
A factory for ValueList instances.
All implementations are thread-safe and support concurrent access.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface is.codion.common.reactive.value.Value
Value.BuilderFactory, 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> values) Creates a newValueList.Builderinstance.Returns anObservableValueCollectionnotified each time this value changes.static <T> ValueList<T> Creates a new emptyValueList, usingValue.Notify.CHANGED.static <T> ValueList<T> valueList(Collection<T> values) Creates a newValueList, usingValue.Notify.CHANGED.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface is.codion.common.reactive.observer.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, getOrThrow, getOrThrow, is, isNot, isNull, observer, removeConsumer, removeListener, removeWeakConsumer, removeWeakListenerMethods inherited from interface is.codion.common.reactive.value.ObservableValueCollection
contains, containsAll, isEmpty, size
-
Method Details
-
observable
ObservableValueList<T> observable()Description copied from interface:ValueCollectionReturns anObservableValueCollectionnotified each time this value changes.- Specified by:
observablein interfaceValue<T>- Specified by:
observablein interfaceValueCollection<T,List<T>> - Returns:
- an
ObservableValueCollectionfor this value
-
valueList
Creates a new emptyValueList, usingValue.Notify.CHANGED.- Type Parameters:
T- the value type- Returns:
- a new
ValueList
-
valueList
Creates a newValueList, usingValue.Notify.CHANGED.- Type Parameters:
T- the value type- Parameters:
values- the initial values, may not be null- Returns:
- a new
ValueList - Throws:
NullPointerException- in casevaluesis null
-
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:
values- the initial values, may not be null- Returns:
- a new builder
- Throws:
NullPointerException- in casevaluesis null
-