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, validateCollectionTypeMethods inherited from interface Iterable
forEach, spliterator
-
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>
-