Package com.vaadin.hilla.signals
Class NumberSignal
A signal that holds a number value.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new NumberSignal with the default value of 0.NumberSignal(Double defaultValue) Creates a new NumberSignal with the provided default value. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprocessEvent(com.fasterxml.jackson.databind.node.ObjectNode event) Processes the event and updates the signal value if needed.Methods inherited from class com.vaadin.hilla.signals.ValueSignal
compareAndSet, createSnapshotEvent, getValue
-
Constructor Details
-
NumberSignal
Creates a new NumberSignal with the provided default value.- Parameters:
defaultValue- the default value- Throws:
NullPointerException- if the default value is null
-
NumberSignal
public NumberSignal()Creates a new NumberSignal with the default value of 0.
-
-
Method Details
-
processEvent
protected boolean processEvent(com.fasterxml.jackson.databind.node.ObjectNode event) Processes the event and updates the signal value if needed. Note that this method is not thread-safe and should be called from a synchronized context.- Overrides:
processEventin classValueSignal<Double>- Parameters:
event- the event to process- Returns:
trueif the event was successfully processed and the signal value was updated,falseotherwise.
-