de.caff.util.settings

## Class SimpleNullableProperty<T>

- java.lang.Object
- - de.caff.util.settings.AbstractBasicChangeableItem
  - - de.caff.util.settings.SimpleNullableProperty<T>

- All Implemented Interfaces:
    ChangeableItem, Property<T>, java.io.Serializable
  Direct Known Subclasses:
    SimpleStringPreferenceProperty

      public class SimpleNullableProperty<T>
      extends AbstractBasicChangeableItem
      implements Property<T>

  A simple property which cannot be `null`.

  You can define a specific matcher which allows to define when a value will be changed in the `setValue(Object)` method. The default is to use the `Object.equals(Object)` method.

  Since:
    November 27, 2016
  Author:
    Rammi
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleNullableProperty(java.lang.String basicName)` Constructor.
    `SimpleNullableProperty(java.lang.String basicName, T value)` Constructor.
    `SimpleNullableProperty(java.lang.String basicName, T value, UniformMatcher<? super T> matcher)` Constructor.
    `SimpleNullableProperty(java.lang.String basicName, UniformMatcher<? super T> matcher)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `getValue()` Get the value of the property.
    `void` | `setValue(T value)` Set the value.

    - ### Methods inherited from class de.caff.util.settings.AbstractBasicChangeableItem

      `addValueChangeListener, addValueChangeListenerWeakly, firePropertyChange, fireValueChange, fireValueChange, fireValueChange, getBasicName, getPropertyName, removeValueChangeListener, removeValueChangeListenerWeakly`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface de.caff.util.settings.ChangeableItem

      `addValueChangeListener, addValueChangeListenerWeakly, removeValueChangeListener, removeValueChangeListenerWeakly`

- - ### Constructor Detail

    - #### SimpleNullableProperty

          public SimpleNullableProperty(@NotNull
                                        java.lang.String basicName)

      Constructor. This will use a matcher using the `Object.equals(Object)` method and an initial value of `null`.
      Parameters:
        `basicName` - property name

    - #### SimpleNullableProperty

          public SimpleNullableProperty(@NotNull
                                        java.lang.String basicName,
                                        @Nullable
                                        T value)

      Constructor. This will use an matcher using the `Object.equals(Object)` method.
      Parameters:
        `basicName` - property name
        `value` - initial value

    - #### SimpleNullableProperty

          public SimpleNullableProperty(@NotNull
                                        java.lang.String basicName,
                                        @NotNull
                                        UniformMatcher<? super T> matcher)

      Constructor. This will use an initial value of `null`.
      Parameters:
        `basicName` - property name
        `matcher` - matcher which defines whether a newly set value differs from the current value

    - #### SimpleNullableProperty

          public SimpleNullableProperty(@NotNull
                                        java.lang.String basicName,
                                        @Nullable
                                        T value,
                                        @NotNull
                                        UniformMatcher<? super T> matcher)

      Constructor.
      Parameters:
        `basicName` - property name
        `value` - initial value
        `matcher` - matcher which defines whether a newly set value differs from the current value

  - ### Method Detail

    - #### getValue

          @Nullable
          public T getValue()

      Get the value of the property.
      Specified by:
        `getValue` in interface `Property<T>`
      Returns:
        property value

    - #### setValue

          public void setValue(@Nullable
                               T value)

      Set the value.
      Specified by:
        `setValue` in interface `Property<T>`
      Parameters:
        `value` - new value