- Type Parameters:
T
- the value type
- All Superinterfaces:
Consumer<Set<T>>
,Iterable<T>
,Observer<Set<T>>
,Value<Set<T>>
,ValueObserver<Set<T>>
,Values<T,
,Set<T>> ValuesObserver<T,
Set<T>>
An observable wrapper for a Set of values, including a possible null value.
A factory for
ValueSet
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> ValueSet.Builder<T>
builder()
Creates a newValueSet.Builder
instance.static <T> ValueSet.Builder<T>
builder
(Collection<T> value) Creates a newValueSet.Builder
instance.observer()
Returns aValuesObserver
notified each time this value changes.static <T> ValueSet<T>
valueSet()
Creates a new emptyValueSet
, usingValue.Notify.WHEN_CHANGED
.static <T> ValueSet<T>
valueSet
(Collection<T> value) Creates a newValueSet
, 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
ValueSetObserver<T> observer()Description copied from interface:Values
Returns aValuesObserver
notified each time this value changes. -
valueSet
Creates a new emptyValueSet
, usingValue.Notify.WHEN_CHANGED
.- Type Parameters:
T
- the value type- Returns:
- a new
ValueSet
-
valueSet
Creates a newValueSet
, usingValue.Notify.WHEN_CHANGED
.- Type Parameters:
T
- the value type- Parameters:
value
- the initial value, may not be null- Returns:
- a new
ValueSet
-
builder
Creates a newValueSet.Builder
instance.- Type Parameters:
T
- the value set type- Returns:
- a new builder
-
builder
Creates a newValueSet.Builder
instance.- Type Parameters:
T
- the value set type- Parameters:
value
- the initial value- Returns:
- a new builder
- Throws:
NullPointerException
- in casevalue
is null
-