# Class NumericProperty<T,K>

java.lang.Object
com.codename1.properties.PropertyBase<T,K>
com.codename1.properties.Property<T,K>
com.codename1.properties.NumericProperty<T,K>

Direct Known Subclasses:
  `ByteProperty, CharProperty, DoubleProperty, FloatProperty, IntProperty, LongProperty`

public abstract class NumericProperty<T,K> extends Property<T,K>
This is the base class to all number properties, it introduces nullability and the ability to convert to all number types.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NumericProperty(String name)`
  Creates a numeric property with the given name.
  `NumericProperty(String name, Class genericType)`
  Creates a numeric property with the given name and explicit value type.
  `NumericProperty(String name, Class genericType, T value)`
  Creates a numeric property with the given name, type, and initial value.
  `NumericProperty(String name, T value)`
  Creates a numeric property with the given name and initial value.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isNullable()`
  If the field is nullable `set(null)` will fail
  `K`
  `set(T value)`
  Sets the property value and potentially fires a change event
  `void`
  `setNullable(boolean nullable)`
  If the field is nullable `set(null)` will fail

  ### Methods inherited from class Property

  `equals, get, hashCode, toString`

  ### Methods inherited from class PropertyBase

  `addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, validateCollectionType`

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`

- ## 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 fail

    ###### Returns

    the nullable

  - ### setNullable

    public void setNullable(boolean nullable)

    If the field is nullable `set(null)` will fail

    ###### Parameters

    - `nullable`: the nullable to set

  - ### set

    public K set(T value)
    Description copied from class: `Property`

    Sets the property value and potentially fires a change event

    ###### Parameters

    - `value`: the new value
    Overrides:
      `set` in class `Property<T,K>`