Class SetProperty<T,K>
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionSetProperty(String name) Constructs a property with null valueSetProperty(String name, Class<T> elementType, T... values) Constructs a property with the given name and values by specifying the type of the elements explicitly.SetProperty(String name, T... values) Constructs a property with the given name and value -
Method Summary
Modifier and TypeMethodDescriptionAdds a property value to the set and fires a change event if it changed the setaddAll(Collection<? extends T> v) Adds a collection of values to the set and fires a change event if it changed the setReturns a copy of the content as a new list but if the value is a PropertyBusinessObject it will be converted to a MapasList()Returns a copy of the content as a new listvoidclear()Remove all the elements from the set and fires a change event if the set wasn't emptybooleanReturns true if the given element is contained in the set propertybooleanCompares this property to another propertyinthashCode()Returns the internal hashcode or 0 for null propertyiterator()Iterate over the elements of the propertyremove(int v) Removes the given item from the set and fires a change event if this item has been successfully removedRemoves the given item from the set and fires a change event if this item has been successfully removedremoveAll(Collection<? extends T> v) Removes from the set all values from the given collection and fires a change event if the set has changedset(Collection<T> t) Sets the entire content of the propertyintsize()The size of the property setMethods inherited from class PropertyBase
addChangeListener, bindGlobalGetListener, bindGlobalSetListener, firePropertyChanged, getClientProperty, getGenericType, getLabel, getName, putClientProperty, removeChangeListener, setLabel, stopListening, toString, validateCollectionTypeModifier and TypeMethodDescriptionvoidFires a notification that a property value changed to the given listenerstatic voidbindGlobalGetListener(PropertyChangeListener listener) Binds an event callback for get calls and property readsstatic voidbindGlobalSetListener(PropertyChangeListener listener) Binds an event callback for set calls and property mutationprotected voidDelivers the property change event to listeners if applicablegetClientProperty(String key) Returns the client property set to this property nameReturns the generic type of this property if it is known or nullgetLabel()The label of the property defaults to its name but can be changed to anythinggetName()The property name is immutable and can't be changed after creation it should match the parent field name by conventionvoidputClientProperty(String key, Object o) Places a property that will apply statically to all instances of this propertyvoidRemoves the property change listener from the list of listenersvoidThe label of the property defaults to its name but can be changed to anything, it can be used when binding a property to UI elementsvoidThis method will work when invoked from a propertyChanged callback and should be similar toremovePropertyChangeListener(this).toString()Default toString that provides easier debug informationprotected final voidvalidateCollectionType(Class elementType) Validates that the collection type is valid and throws an exception otherwiseMethods inherited from class Object
clone, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()final ClassgetClass()Returns the runtime class of an object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(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 voidwait(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
-
SetProperty
-
SetProperty
Constructs a property with the given name and values by specifying the type of the elements explicitly. The element type needs to be specified if the set should contain
PropertyBusinessObjects and needs to get deserialized properly!Parameters
-
name: the name of the property -
elementType: subclass ofPropertyBusinessObject -
values: default values for the property
-
-
SetProperty
Constructs a property with null value
Parameters
name: the name of the property
-
-
Method Details
-
size
public int size()The size of the property set
Returns
the number of elements
- Specified by:
sizein classCollectionProperty<T,K>
-
set
Sets the entire content of the property
Parameters
t: the collection of elements to set
Returns
the parent object for chaining
- Specified by:
setin classCollectionProperty<T,K>
-
add
-
addAll
Adds a collection of values to the set and fires a change event if it changed the set
Parameters
v: the new value
- Specified by:
addAllin classCollectionProperty<T,K>
-
remove
-
remove
Removes the given item from the set and fires a change event if this item has been successfully removed
Parameters
v: the item to remove
- Specified by:
removein classCollectionProperty<T,K>
-
removeAll
Removes from the set all values from the given collection and fires a change event if the set has changed
Parameters
the: item to remove
- Specified by:
removeAllin classCollectionProperty<T,K>
-
equals
Compares this property to another property
Parameters
obj: the other property
Returns
true if they are equal in name and value
- Overrides:
equalsin classPropertyBase<T,K>
-
hashCode
public int hashCode()Returns the internal hashcode or 0 for null property
Returns
the hashcode value
- Overrides:
hashCodein classPropertyBase<T,K>
-
iterator
-
asList
-
asExplodedList
Returns a copy of the content as a new list but if the value is a PropertyBusinessObject it will be converted to a Map
Returns
a list
- Specified by:
asExplodedListin classCollectionProperty<T,K>
-
clear
public void clear()Remove all the elements from the set and fires a change event if the set wasn't empty- Specified by:
clearin classCollectionProperty<T,K>
-
contains
Returns true if the given element is contained in the set property
Parameters
element: the element
Returns
true if the given element is contained in the set property
- Specified by:
containsin classCollectionProperty<T,K>
-