Class FieldValueChangeEvent
java.lang.Object
com.vaadin.flow.component.ai.form.FieldValueChangeEvent
- All Implemented Interfaces:
Serializable
Fired by
FormAIController once per field whose value changed during a
successful AI turn — either written by the LLM or by a cascade. Events fire
in document order, after every field's post-turn value has been applied. A
field whose post-turn value equals its pre-turn value (by
Objects.equals(Object, Object)) does not produce an event. No events
fire when the turn ended in error.- Since:
- 25.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionHasValue<?, ?> getField()Returns the field whose value changed during this turn.Returns the source data the LLM reported for the value it wrote to this field: the snippets it read and how sure it was.Returns the field's value at the end of the turn, after the LLM's writes and any cascading value-change listeners have settled.Returns the field's value at the start of the turn, before the LLM ran.Returns the controller that produced this event.
-
Method Details
-
getSource
Returns the controller that produced this event. Listeners can use this to call back into the controller without capturing it from the registration site.The source is transient, so it is
nullon an event restored from a serialized session.- Returns:
- the source controller, or
nullif this event was deserialized
-
getField
Returns the field whose value changed during this turn.- Returns:
- the changed field, never
null
-
getOldValue
Returns the field's value at the start of the turn, before the LLM ran. For a field that was hidden at turn start and revealed during the turn, this is the field's actual pre-turn value rather thannull. For a field added to the form during the turn, this is the field'sempty value— the field had no pre-turn value to report.- Returns:
- the pre-turn value, possibly
null
-
getNewValue
Returns the field's value at the end of the turn, after the LLM's writes and any cascading value-change listeners have settled.- Returns:
- the post-turn value, possibly
null
-
getFieldSource
Returns the source data the LLM reported for the value it wrote to this field: the snippets it read and how sure it was. Present only whensource trackingis on and the model reported a source for this value; a value with nothing to point at — for example one taken from the chat prompt — carries none.- Returns:
- the reported source, or empty when none was reported
-