public abstract class NumericProperty<T, K>
- Object
- PropertyBase<T, K>
- Property<T, K>
- NumericProperty
Known subtypesByteProperty, CharProperty, DoubleProperty, FloatProperty, IntProperty, LongProperty
This is the base class to all number properties, it introduces nullability and the ability to convert to all
number types.
Constructors
public NumericProperty(String name) | Creates a numeric property with the given name. |
public NumericProperty(String name, Class genericType) | Creates a numeric property with the given name and explicit value type. |
public NumericProperty(String name, T value) | Creates a numeric property with the given name and initial value. |
public NumericProperty(String name, Class genericType, T value) | Creates a numeric property with the given name, type, and initial value. |
Methods
public boolean isNullable() | If the field is nullable set(null) will fail |
public void setNullable(boolean nullable) | If the field is nullable set(null) will fail |
public K set(T value) | Sets the property value and potentially fires a change event |
Inherited methods
Constructor details
NumericProperty
public NumericProperty(String name)Creates a numeric property with the given name.
NumericProperty
public NumericProperty(String name, Class genericType)Creates a numeric property with the given name and explicit value type.
NumericProperty
public NumericProperty(String name, T value)Creates a numeric property with the given name and initial value.
NumericProperty
public NumericProperty(String name, Class genericType, T value)Creates a numeric property with the given name, type, and initial value.
Method details
isNullable
public boolean isNullable()If the field is nullable
set(null) will failReturns
the nullable
setNullable
public void setNullable(boolean nullable)If the field is nullable
set(null) will failParameters
nullableboolean- the nullable to set
set
public K set(T value)Sets the property value and potentially fires a change event
Parameters
valueT- the new value