org.omnaest.utils.beans.result
Class BeanPropertyAccessors<B>

java.lang.Object
  extended by org.omnaest.utils.beans.result.BeanPropertyAccessors<B>
Type Parameters:
B - type of the Java Bean
All Implemented Interfaces:
Iterable<BeanPropertyAccessor<B>>, Collection<BeanPropertyAccessor<B>>

public class BeanPropertyAccessors<B>
extends Object
implements Collection<BeanPropertyAccessor<B>>

Container for a ordered set of BeanPropertyAccessor instances.

Author:
Omnaest

Field Summary
protected  List<BeanPropertyAccessor<B>> beanPropertyAccessorList
           
 
Constructor Summary
BeanPropertyAccessors()
           
BeanPropertyAccessors(Collection<BeanPropertyAccessor<B>> beanPropertyAccessorCollection)
           
 
Method Summary
 boolean add(BeanPropertyAccessor<B> e)
          Adds a BeanPropertyAccessor to the BeanPropertyAccessors container
 boolean addAll(Collection<? extends BeanPropertyAccessor<B>> collection)
          Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container
 boolean addAll(Iterable<? extends BeanPropertyAccessor<B>> iterable)
          Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container
 void clear()
          Clears the BeanPropertyAccessors container
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 void copyPropertyValues(B beanSource, B beanDestination)
          Copies the values of all related properties of the given source Java Bean to the destination Java Bean.
 BeanPropertyAccessor<B> get(int index)
          Gets the BeanPropertyAccessor at the given index position
 boolean isEmpty()
          Returns true if the BeanPropertyAccessors container has no BeanPropertyAccessor instances
 Iterator<BeanPropertyAccessor<B>> iterator()
           
 boolean remove(BeanPropertyAccessor<B> beanPropertyAccessor)
          Removes a BeanPropertyAccessor instance from the BeanPropertyAccessors container
 BeanPropertyAccessor<B> remove(int index)
          Removes the BeanPropertyAccessor at the given index position
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 int size()
          Returns the size of the BeanPropertyAccessors container
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

beanPropertyAccessorList

protected List<BeanPropertyAccessor<B>> beanPropertyAccessorList
Constructor Detail

BeanPropertyAccessors

public BeanPropertyAccessors()
See Also:
BeanPropertyAccessors

BeanPropertyAccessors

public BeanPropertyAccessors(Collection<BeanPropertyAccessor<B>> beanPropertyAccessorCollection)
Parameters:
beanPropertyAccessorCollection -
See Also:
BeanPropertyAccessors
Method Detail

copyPropertyValues

public void copyPropertyValues(B beanSource,
                               B beanDestination)
Copies the values of all related properties of the given source Java Bean to the destination Java Bean. The affected properties are based on the BeanPropertyAccessor instances within the BeanPropertyAccessors container.

Parameters:
beanSource -
beanDestination -

size

public int size()
Returns the size of the BeanPropertyAccessors container

Specified by:
size in interface Collection<BeanPropertyAccessor<B>>

isEmpty

public boolean isEmpty()
Returns true if the BeanPropertyAccessors container has no BeanPropertyAccessor instances

Specified by:
isEmpty in interface Collection<BeanPropertyAccessor<B>>
Returns:

add

public boolean add(BeanPropertyAccessor<B> e)
Adds a BeanPropertyAccessor to the BeanPropertyAccessors container

Specified by:
add in interface Collection<BeanPropertyAccessor<B>>
Parameters:
e -
Returns:

remove

public boolean remove(BeanPropertyAccessor<B> beanPropertyAccessor)
Removes a BeanPropertyAccessor instance from the BeanPropertyAccessors container

Parameters:
beanPropertyAccessor -
Returns:

addAll

public boolean addAll(Collection<? extends BeanPropertyAccessor<B>> collection)
Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container

Specified by:
addAll in interface Collection<BeanPropertyAccessor<B>>
Parameters:
collection - Collection
Returns:

addAll

public boolean addAll(Iterable<? extends BeanPropertyAccessor<B>> iterable)
Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container

Parameters:
iterable -
Returns:

clear

public void clear()
Clears the BeanPropertyAccessors container

Specified by:
clear in interface Collection<BeanPropertyAccessor<B>>

iterator

public Iterator<BeanPropertyAccessor<B>> iterator()
Specified by:
iterator in interface Iterable<BeanPropertyAccessor<B>>
Specified by:
iterator in interface Collection<BeanPropertyAccessor<B>>

remove

public BeanPropertyAccessor<B> remove(int index)
Removes the BeanPropertyAccessor at the given index position

Parameters:
index -
Returns:

get

public BeanPropertyAccessor<B> get(int index)
Gets the BeanPropertyAccessor at the given index position

Parameters:
index -
Returns:

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<BeanPropertyAccessor<B>>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<BeanPropertyAccessor<B>>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<BeanPropertyAccessor<B>>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<BeanPropertyAccessor<B>>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<BeanPropertyAccessor<B>>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<BeanPropertyAccessor<B>>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<BeanPropertyAccessor<B>>


Copyright © 2013. All Rights Reserved.