com.vaadin.data.

Class HasValue.ValueChangeEvent<V>

    • Constructor Detail

      • ValueChangeEvent

        public ValueChangeEvent​(COMPONENT component,
                                V oldValue,
                                boolean userOriginated)

        Creates a new ValueChange event containing the current value of the given value-bearing source component.

        Type Parameters:

        COMPONENT - the type of the source component

        Parameters:

        component - the source component bearing the value, not null

        oldValue - the previous value held by the source of this event

        userOriginated - true if this event originates from the client, false otherwise.

      • ValueChangeEvent

        public ValueChangeEvent​(Component component,
                                HasValue<V> hasValue,
                                V oldValue,
                                boolean userOriginated)

        Creates a new ValueChange event containing the given value, originating from the given source component.

        Parameters:

        component - the component, not null

        hasValue - the HasValue instance bearing the value, not null

        oldValue - the previous value held by the source of this event

        userOriginated - true if this event originates from the client, false otherwise.

    • Method Detail

      • getOldValue

        public V getOldValue()

        Returns the value of the source before this value change event occurred.

        Returns:

        the value previously held by the source of this event

      • getValue

        public V getValue()

        Returns the new value that triggered this value change event.

        Returns:

        the new value

      • isUserOriginated

        public boolean isUserOriginated()

        Description copied from interface: HasUserOriginated

        Returns whether this event was triggered by user interaction, on the client side, or programmatically, on the server side.

        Specified by:

        isUserOriginated in interface HasUserOriginated

        Returns:

        true if this event originates from the client, false otherwise.

      • getComponent

        public Component getComponent()

        Returns the component.

        Returns:

        the component, not null