# Class ByteProperty<K>

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

public class ByteProperty<K> extends NumericProperty<Byte,K>
This is the byte specific version of numeric property

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ByteProperty(String name)`
  Creates a byte property with the given name.
  `ByteProperty(String name, Byte value)`
  Creates a byte property with the given name and initial value.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte`
  `getByte()`
  Returns the value as a primitive, if the value is null/nullable this will fail...

  ### Methods inherited from class NumericProperty

  `isNullable, set, setNullable`
  Modifier and Type
  Method
  Description
  `boolean`
  `isNullable()`
  If the field is nullable `set(null)` will fail
  `K`
  `set(Byte 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`
  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  Compares this property to another property
  `Byte`
  `get()`
  Gets the property value
  `int`
  `hashCode()`
  Returns the internal hashcode or 0 for null property
  `String`
  `toString()`
  Default toString that provides easier debug information

  ### Methods inherited from class PropertyBase

  `addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, validateCollectionType`
  Modifier and Type
  Method
  Description
  `void`
  `addChangeListener(PropertyChangeListener<Byte,K> pl)`
  Fires a notification that a property value changed to the given listener
  `static void`
  `bindGlobalGetListener(PropertyChangeListener listener)`
  Binds an event callback for get calls and property reads
  `static void`
  `bindGlobalSetListener(PropertyChangeListener listener)`
  Binds an event callback for set calls and property mutation
  `protected void`
  `firePropertyChanged()`
  Delivers the property change event to listeners if applicable
  `Object`
  `getClientProperty(String key)`
  Returns the client property set to this property name
  `Class`
  `getGenericType()`
  Returns the generic type of this property if it is known or null
  `String`
  `getLabel()`
  The label of the property defaults to its name but can be changed to anything
  `String`
  `getName()`
  The property name is immutable and can't be changed after creation it should match the parent field name by convention
  `void`
  `putClientProperty(String key, Object o)`
  Places a property that will apply statically to all instances of this property
  `void`
  `removeChangeListener(PropertyChangeListener<Byte,K> pl)`
  Removes the property change listener from the list of listeners
  `void`
  `setLabel(String label)`
  The label of the property defaults to its name but can be changed to anything, it can be used when binding a property to UI elements
  `void`
  `stopListening()`
  This method will work when invoked from a propertyChanged callback and should be similar to `removePropertyChangeListener(this)`.
  `protected final void`
  `validateCollectionType(Class elementType)`
  Validates that the collection type is valid and throws an exception otherwise

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### ByteProperty

    public ByteProperty(String name)
    Creates a byte property with the given name.

  - ### ByteProperty

    public ByteProperty(String name, Byte value)
    Creates a byte property with the given name and initial value.

- ## Method Details

  - ### getByte

    public byte getByte()

    Returns the value as a primitive, if the value is null/nullable this will fail...

    ###### Returns

    the numeric value