- Type Parameters:
T
- the value type
- All Superinterfaces:
Iterable<T>
,Observable<List<T>>
,ObservableValues<T,
,List<T>> Observer<List<T>>
,Value<List<T>>
,Values<T,
List<T>>
An observable wrapper for a List of values.
A factory for ValueList
instances.
-
Nested Class Summary
Nested classes/interfaces inherited from interface is.codion.common.value.Value
Value.BuilderFactory, Value.Notify, Value.Validator<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueList.Builder<T>
builder()
Creates a newValueList.Builder
instance.static <T> ValueList.Builder<T>
builder
(Collection<T> values) Creates a newValueList.Builder
instance.Returns anObservableValues
notified each time this value changes.static <T> ValueList<T>
Creates a new emptyValueList
, usingValue.Notify.WHEN_CHANGED
.static <T> ValueList<T>
valueList
(Collection<T> values) Creates a newValueList
, usingValue.Notify.WHEN_CHANGED
.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface is.codion.common.observable.Observable
addConsumer, addListener, addWeakConsumer, addWeakListener, getOrThrow, getOrThrow, isEqualTo, isNotEqualTo, isNull, observer, optional, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
Methods inherited from interface is.codion.common.value.ObservableValues
contains, containsAll, isEmpty, size
-
Method Details
-
observable
ObservableValueList<T> observable()Description copied from interface:Values
Returns anObservableValues
notified each time this value changes.- Specified by:
observable
in interfaceValue<T>
- Specified by:
observable
in interfaceValues<T,
List<T>> - Returns:
- an
ObservableValues
for this value
-
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:
values
- the initial values, may not be null- Returns:
- a new
ValueList
- Throws:
NullPointerException
- in casevalues
is null
-
builder
Creates a newValueList.Builder
instance.- Type Parameters:
T
- the value set type- Returns:
- a new builder
-
builder
Creates a newValueList.Builder
instance.- Type Parameters:
T
- the value set type- Parameters:
values
- the initial values, may not be null- Returns:
- a new builder
- Throws:
NullPointerException
- in casevalues
is null
-