Interface ValueHolder<T>

Type Parameters:
T - The type of the value held by the implementor.
All Known Implementing Classes:
AbstractValueHoldingSwingGadget

public interface ValueHolder<T>
Aspect definition for a persistency object holder of a specified type of value. The parameterization of T must correspond to the concrete value type of a Gadget component.

The outer framework guarantees that none of this interface's methods gets invoked before the gadget's component was requested.

The AbstractValueHoldingSwingGadget provides an abstract implementation with supporting functionality and a small sub-type API. It is recommended, but not obligatory to sub-class the abstract implementation.

Since:
4.2.405
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final AspectType<ValueHolder<?>>
    The aspect's generic type to access the value holding container in an unchecked way.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current value stored by this value holder.
    boolean
    Indicates that the currently hold value is considered to represent an empty value.
    void
    setValue(T value)
    Set the given value to be stored by this value holder.
  • Field Details

    • TYPE

      static final AspectType<ValueHolder<?>> TYPE
      The aspect's generic type to access the value holding container in an unchecked way.
      Since:
      4.2.405
  • Method Details

    • getValue

      @Nullable T getValue()
      Get the current value stored by this value holder.
      Returns:
      The currently stored value.
      Since:
      4.2.405
    • setValue

      @RunsInEDT void setValue(@Nullable T value)
      Set the given value to be stored by this value holder.

      The outer framework guarantees, that this method will always be invoked from within the event dispatcher thread!

      Parameters:
      value - A value to store.
      Since:
      4.2.405
    • isEmpty

      boolean isEmpty()
      Indicates that the currently hold value is considered to represent an empty value.
      Returns:
      true, if value is considered empty.
      Since:
      4.2.405