1 package com.fermod.example;
8 public static void main(String[] args) {
14 System.out.println(
"Executed lambda inline code. Old value: " + oldVAlue +
" New value: " + newValue);
20 public void onValueChanged(Integer oldValue, Integer value) {
21 System.out.println(
"Executed inline code. Old value: " + oldValue +
" New value: " + value);
28 System.out.println(
"Change value to 10");
29 observedValue.
set(10);
34 System.out.println(
"Executed printValueChange method. Old value: " + oldValue +
" New value: " + newValue);
Class that wraps a value and gives the utility of registering listeners that will be called after any...
static void printValueChange(int oldValue, int newValue)
static void main(String[] args)
T registerListener(T listener)
Adds the specified listener to the list of registered listeners.
The listener interface for receiving value change events.
void set(T value)
Changes the value with the new given one, and notifies all the registered listeners of the change.