Class DefaultableProperty<T>

java.lang.Object
com.thecsdev.common.properties.ObjectProperty<T>
com.thecsdev.common.properties.DefaultableProperty<T>

@Virtual public class DefaultableProperty<T> extends ObjectProperty<T>
An ObjectProperty whose value defaults to getDefaultValue() when attempting to ObjectProperty.set(Object) it to null.
  • Constructor Details

    • DefaultableProperty

      public DefaultableProperty(@Nullable T defaultValue)
    • DefaultableProperty

      public DefaultableProperty(@Nullable T value, @Nullable T defaultValue)
  • Method Details

    • getDefaultValue

      @Nullable public final T getDefaultValue()
      Returns the default value that is assigned when attempting to set the value to null.