V
- Value typepublic interface ValueHolder<V> extends Serializable
Modifier and Type | Interface and Description |
---|---|
static interface |
ValueHolder.MaySupportValueChangeMode
Declares that the
ValueChangeMode handling may be supported and provides methods to configure it. |
static interface |
ValueHolder.ValueChangeEvent<V>
A
ValueHolder.ValueChangeListener event. |
static interface |
ValueHolder.ValueChangeListener<V>
A listener for
ValueHolder value change events. |
Modifier and Type | Method and Description |
---|---|
com.vaadin.shared.Registration |
addValueChangeListener(ValueHolder.ValueChangeListener<V> listener)
Adds a value change listener, called when the value changes.
|
default void |
clear()
Clears this value holder.
|
default V |
getEmptyValue()
Returns the value that represents an empty value.
|
default Optional<V> |
getOptionalValue()
Gets the current value of this value holder as an
Optional , which will be empty if the value holder is
considered to be empty. |
V |
getValue()
Gets the current value of this value holder.
|
default Optional<V> |
getValueIfPresent()
Get the current value of this value holder, if available (i.e. not
null ). |
default boolean |
isEmpty()
Returns whether this value holder is considered to be empty, according to its current value.
|
void |
setValue(V value)
Sets the
value of this value holder. |
void setValue(V value)
value
of this value holder.value
- the value to setIllegalArgumentException
- if the value is not validV getValue()
default Optional<V> getValueIfPresent()
null
).default V getEmptyValue()
null
by default)default boolean isEmpty()
By default this is an equality check between current value and empty value.
true
if considered empty, false
if notdefault void clear()
By default, resets the value to the empty one.
default Optional<V> getOptionalValue()
Optional
, which will be empty if the value holder is
considered to be empty.com.vaadin.shared.Registration addValueChangeListener(ValueHolder.ValueChangeListener<V> listener)
listener
- the value change listener to add (not null)Copyright © 2019 The Holon Platform. All rights reserved.