public abstract class CollectionProperty<T, K>

  1. Object
  2. PropertyBase<T, K>
  3. CollectionProperty

ImplementsIterable<T>

Known subtypesListProperty, SetProperty

Base class for a property as a collection which can contain multiple elements within

Constructors

public CollectionProperty(String name)
public CollectionProperty(String name, Class genericType)

Methods

public abstract int size()The size of the property collection
public abstract K set(Collection<T> t)Sets the entire content of the property
public abstract K add(T v)Adds a property value to the collection and fires a change event if collection has changed
public abstract K addAll(Collection<? extends T> v)Adds a collection of values to the collection and fires a change event if the collection has changed
public abstract K remove(T v)Removes the given item
public abstract K remove(int offset)Removes the given item
public abstract K removeAll(Collection<? extends T> v)Removes from this collection all of its elements that are contained in the specified collection and fires a change event if the collection has changed
public abstract Iterator<T> iterator()Iterate over the elements of the property
public abstract List<T> asList()Returns a copy of the content as a new list
public abstract List<Object> 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
public abstract void clear()Remove all the elements from the collection and fires a change event
public abstract boolean contains(T element)Returns true if the given element is contained in the collection property

Inherited methods

Constructor details

CollectionProperty

public CollectionProperty(String name)

CollectionProperty

public CollectionProperty(String name, Class genericType)

Method details

size

public abstract int size()
The size of the property collection

Returns

the number of elements

set

public abstract K set(Collection<T> t)
Sets the entire content of the property

Parameters

t Collection<T>
the collection of elements to set

Returns

the parent object for chaining

add

public abstract K add(T v)
Adds a property value to the collection and fires a change event if collection has changed

Parameters

v T
the new value

addAll

public abstract K addAll(Collection<? extends T> v)
Adds a collection of values to the collection and fires a change event if the collection has changed

Parameters

v Collection<? extends T>
the collection of values to add

remove

public abstract K remove(T v)
Removes the given item

Parameters

v T
the item to remove

remove

public abstract K remove(int offset)
Removes the given item

Parameters

offset int
the index

removeAll

public abstract K removeAll(Collection<? extends T> v)
Removes from this collection all of its elements that are contained in the specified collection and fires a change event if the collection has changed

Parameters

v Collection<? extends T>
the collection of values to remove

iterator

public abstract Iterator<T> iterator()
Iterate over the elements of the property

Returns

an iterator

asList

public abstract List<T> asList()
Returns a copy of the content as a new list

Returns

a list

asExplodedList

public abstract List<Object> 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

clear

public abstract void clear()
Remove all the elements from the collection and fires a change event

contains

public abstract boolean contains(T element)
Returns true if the given element is contained in the collection property

Parameters

element T
the element

Returns

true if the given element is contained in the collection property