mmm-value
The module io.github.mmm.value
(artifactId mmm-value
) provides a minimal but powerful API for value containers.
Usage
Maven Dependency:
<dependency>
<groupId>io.github.m-m-m</groupId>
<artifactId>mmm-value</artifactId>
</dependency>
Module Dependency:
requires transitive io.github.mmm.value;
mmm-value-observable
The module io.github.mmm.value.observable
(artifactId mmm-value-observable
) provides observable values that allow to add and remove listeners to observe the value and get notified about changes. All is inspired by ObservableValue
from JavaFx.
Usage
Maven Dependency:
<dependency>
<groupId>io.github.m-m-m</groupId>
<artifactId>mmm-value-observable</artifactId>
</dependency>
Module Dependency:
requires transitive io.github.mmm.value.observable;
Example
StringExpression observableString = createStringExpression();
observableString.addListener(e -> System.out.print(e.getOldValue() + "-->" + e.getValue()));
observableString.set("John Doe");