Class Signal<T>

java.lang.Object
nl.colorize.util.Signal<T>
Type Parameters:
T - The underlying property's type.
All Implemented Interfaces:
Supplier<T>

public final class Signal<T> extends Object implements Supplier<T>
Wraps an underlying mutable property, allowing subscribers to be notified whenever the property's value changes.
  • Method Details

    • set

      public void set(T newValue)
    • get

      public T get()
      Specified by:
      get in interface Supplier<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • of

      public static <T> Signal<T> of(T initialValue)
      Creates a new Signal with the specified initial value. Note that subscribers will also be notified of this initial value.
    • getChanges

      public Subject<T> getChanges()