Class ConstValue<T>

  • Type Parameters:
    T -

    public class ConstValue<T>
    extends ObservableValue<T>
    Technically an observable, but can't be changed. An attempt to set a new value will result in an UnsupportedOperationException.
    Author:
    Torsten Hildebrandt
    • Constructor Detail

      • ConstValue

        public ConstValue​(T initialValue)
    • Method Detail

      • set

        public final void set​(T newValue)
        Description copied from class: ObservableValue
        Sets a new value. If the new values differs from the old one (checked by Objects.equals(Object, Object)), then all registered listeners are notified about changes.
        Overrides:
        set in class ObservableValue<T>
        Parameters:
        newValue - The new value to store. Can be null.