- Type Parameters:
T
- the value type
- All Superinterfaces:
Consumer<List<T>>
,Iterable<T>
,Observer<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 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> value) Creates a newValueList.Builder
instance.observer()
Returns aValuesObserver
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> value) Creates a newValueList
, usingValue.Notify.WHEN_CHANGED
.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface is.codion.common.observer.Observer
addConsumer, addListener, addWeakConsumer, addWeakListener, removeConsumer, removeListener, removeWeakConsumer, removeWeakListener
Methods inherited from interface is.codion.common.value.Value
accept, addValidator, clear, link, link, map, removeValidator, set, unlink, unlink, validate
Methods inherited from interface is.codion.common.value.ValueObserver
get, isEqualTo, isNotEqualTo, isNotNull, isNull, nullable, optional
Methods inherited from interface is.codion.common.value.Values
add, addAll, addAll, remove, removeAll, removeAll, set, value
Methods inherited from interface is.codion.common.value.ValuesObserver
contains, containsAll, empty, notEmpty, size
-
Method Details
-
observer
ValueListObserver<T> observer()Description copied from interface:Values
Returns aValuesObserver
notified 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:
value
- the initial value, may not be null- Returns:
- a new
ValueList
-
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:
value
- the initial value- Returns:
- a new builder
- Throws:
NullPointerException
- in casevalue
is null
-