Class ListProperty<T,K>
- All Implemented Interfaces:
Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionListProperty(String name) Constructs a property with null valueListProperty(String name, Class<T> elementType, T... values) Constructs a property with the given name and values by specifying the type of the elements explicitly.ListProperty(String name, T... values) Constructs a property with the given name and value -
Method Summary
Modifier and TypeMethodDescriptionAdds a property value and fires a change eventAdds a property value to the end of the list and fires a change eventaddAll(Collection<? extends T> v) Adds a all properties value to the list and fires a change eventReturns 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 listbooleanReturns true if the given element is contained in the list propertybooleanCompares this property to another propertyget(int offset) Gets the property valueinthashCode()Returns the internal hashcode or 0 for null propertyintReturns the index of the given element in the list propertyiterator()Iterate over the elements of the propertyremove(int offset) Removes the item at the given offsetRemoves the item with this valueremoveAll(Collection<? extends T> v) Removes from the list all values from the given collection and fires a change event if the list has changedSets the property value and potentially fires a change eventset(Collection<T> t) Sets the entire content of the propertysetList(Collection<T> t) Historical alias of set(Collection t) Sets the entire content of the propertyintsize()The size of the property listMethods 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
-
ListProperty
-
ListProperty
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 list 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
-
-
ListProperty
Constructs a property with null value
Parameters
name: the name of the property
-
-
Method Details
-
get
Gets the property value
Parameters
offset: the offset within the list
Returns
the property value
-
size
public int size()The size of the property list
Returns
the number of elements
- Specified by:
sizein classCollectionProperty<T,K>
-
set
-
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>
-
setList
Historical alias of set(Collection t) Sets the entire content of the property
Parameters
t: the collection of elements to set
Returns
the parent object for chaining
-
add
-
add
-
addAll
Adds a all properties value to the list and fires a change event
Parameters
v: the collection of values to add
- Specified by:
addAllin classCollectionProperty<T,K>
-
remove
Removes the item at the given offset
Parameters
offset: the offset
- Specified by:
removein classCollectionProperty<T,K>
-
remove
-
removeAll
Removes from the list all values from the given collection and fires a change event if the list 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 list- Specified by:
clearin classCollectionProperty<T,K>
-
contains
Returns true if the given element is contained in the list property
Parameters
element: the element
Returns
true if the given element is contained in the list property
- Specified by:
containsin classCollectionProperty<T,K>
-
indexOf
Returns the index of the given element in the list property
Parameters
element: the element
Returns
the index of the given element in the list property
-