Package com.vaadin.flow.component
Class AbstractField.ComponentValueChangeEvent<C extends Component,V>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<C>
-
- com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C,V>
-
- Type Parameters:
C- the source component typeV- the value type
- All Implemented Interfaces:
HasValue.ValueChangeEvent<V>,Serializable
- Direct Known Subclasses:
MultiSelectionEvent,SingleSelectionEvent
- Enclosing class:
- AbstractField<C extends AbstractField<C,T>,T>
public static class AbstractField.ComponentValueChangeEvent<C extends Component,V> extends ComponentEvent<C> implements HasValue.ValueChangeEvent<V>
Value change event fired by components.- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ComponentValueChangeEvent(C source, HasValue<?,V> hasValue, V oldValue, boolean fromClient)Creates a new component value change event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HasValue<?,V>getHasValue()VgetOldValue()Returns the value of the source before this value change event occurred.VgetValue()Returns the new value that triggered this value change event.StringtoString()-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.vaadin.flow.component.HasValue.ValueChangeEvent
isFromClient
-
-
-
-
Constructor Detail
-
ComponentValueChangeEvent
public ComponentValueChangeEvent(C source, HasValue<?,V> hasValue, V oldValue, boolean fromClient)
Creates a new component value change event.- Parameters:
source- the source componenthasValue- the HasValue from which the value originatesoldValue- the old valuefromClient- whether the value change originated from the client
-
-
Method Detail
-
getOldValue
public V getOldValue()
Description copied from interface:HasValue.ValueChangeEventReturns the value of the source before this value change event occurred.- Specified by:
getOldValuein interfaceHasValue.ValueChangeEvent<C extends Component>- Returns:
- the value previously held by the source of this event
-
getValue
public V getValue()
Description copied from interface:HasValue.ValueChangeEventReturns the new value that triggered this value change event.- Specified by:
getValuein interfaceHasValue.ValueChangeEvent<C extends Component>- Returns:
- the new value
-
getHasValue
public HasValue<?,V> getHasValue()
This is typically the same instance as
ComponentEvent.getSource(), but in some cases theHasValueimplementation is separated from the component implementation.- Specified by:
getHasValuein interfaceHasValue.ValueChangeEvent<C extends Component>
-
toString
public String toString()
- Overrides:
toStringin classEventObject
-
-