- Type Parameters:
T- the value type
- All Superinterfaces:
Consumer<Set<T>>,EventObserver<Set<T>>,Iterable<T>,Supplier<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 ClassesNested classes/interfaces inherited from interface is.codion.common.value.Value
Value.Notify, Value.Validator<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueSet.Builder<T>builder()Creates a newValueSet.Builderinstance.static <T> ValueSet.Builder<T>builder(Collection<T> initialValue) Creates a newValueSet.Builderinstance.observer()Returns aValuesObservernotified 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> initialValue) Creates a newValueSet, 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
ValueSetObserver<T> observer()Description copied from interface:ValuesReturns aValuesObservernotified 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:
initialValue- the initial value, may not be null- Returns:
- a new
ValueSet
-
builder
Creates a newValueSet.Builderinstance.- Type Parameters:
T- the value set type- Returns:
- a new builder
-
builder
Creates a newValueSet.Builderinstance.- Type Parameters:
T- the value set type- Parameters:
initialValue- the initial value- Returns:
- a new builder
- Throws:
NullPointerException- in caseinitialValueis null
-