Package: groovy.swing.model

## [Java] Class ValueHolder

- groovy.swing.model.ValueHolder

- All Implemented Interfaces and Traits:
    ValueModel

      public class ValueHolder
      extends Object
      implements ValueModel

  A mutable ValueModel implementation that stores a local value and optionally emits change events.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `ValueHolder()` Creates a holder with Object as its declared type.
    `ValueHolder(Class type)` Creates a holder with the supplied declared type.
    `ValueHolder(Object value)` Creates a holder initialized with the supplied value.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `addPropertyChangeListener(PropertyChangeListener listener)` Add a PropertyChangeListener to the listener list.
    `` | `public Class` | `getType()` Returns the declared value type for this holder.
    `` | `public Object` | `getValue()` Returns the current stored value.
    `` | `public boolean` | `isEditable()` Indicates whether callers should treat this holder as writable.
    `` | `public void` | `removePropertyChangeListener(PropertyChangeListener listener)` Removes a PropertyChangeListener from the listener list.
    `` | `public void` | `setEditable(boolean editable)` Controls whether callers should treat this holder as writable.
    `` | `public void` | `setValue(Object value)` Updates the current value and notifies registered listeners of the change.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public ValueHolder()

      Creates a holder with Object as its declared type.

    - #### public ValueHolder(Class type)

      Creates a holder with the supplied declared type.

      Parameters:
        `type` - the declared value type

    - #### public ValueHolder(Object value)

      Creates a holder initialized with the supplied value.

      Parameters:
        `value` - the initial value

  - ### Method Detail

    - #### public void addPropertyChangeListener(PropertyChangeListener listener)

      Add a PropertyChangeListener to the listener list.

      Parameters:
        `listener` - The listener to add.

    - #### public Class getType()

      Returns the declared value type for this holder.

      Returns:
        the holder type

    - #### public Object getValue()

      Returns the current stored value.

      Returns:
        the current value

    - #### public boolean isEditable()

      Indicates whether callers should treat this holder as writable.

      Returns:
        `true` when the holder is editable

    - #### public void removePropertyChangeListener(PropertyChangeListener listener)

      Removes a PropertyChangeListener from the listener list.

      Parameters:
        `listener` - The listener to remove.

    - #### public void setEditable(boolean editable)

      Controls whether callers should treat this holder as writable.

      Parameters:
        `editable` - `true` to mark the holder as editable

    - #### public void setValue(Object value)

      Updates the current value and notifies registered listeners of the change.

      Parameters:
        `value` - the new value