org.omnaest.utils.beans.autowired
Class AutowiredContainerAbstract<E>

java.lang.Object
  extended by org.omnaest.utils.beans.autowired.AutowiredContainerAbstract<E>
Type Parameters:
E -
All Implemented Interfaces:
Serializable, Iterable<E>, AutowiredContainer<E>
Direct Known Subclasses:
ClassMapToAutowiredContainerAdapter, TypeToAutowiredPropertyContainerAdapter

public abstract class AutowiredContainerAbstract<E>
extends Object
implements AutowiredContainer<E>

Abstract implementation for AutowiredContainer which reduces the number of methods to be implemented.

Author:
Omnaest
See Also:
Serialized Form

Constructor Summary
AutowiredContainerAbstract()
           
 
Method Summary
<O extends E>
boolean
containsAssignable(Class<O> type)
          Returns true if the current container contains any type which can be assigned to the given one.
 boolean equals(Object obj)
           
<O extends E>
O
getValue(Class<? extends O> clazz)
          Returns the value which can be assigned as value to the given Class type.
 int hashCode()
           
 boolean isEmpty()
          Returns true if there are no elements within this container.
 AutowiredContainer<E> putAll(Iterable<E> iterable)
          Adds multiple Objects to the AutowiredContainer.
<O extends E>
AutowiredContainer<E>
remove(O object)
          Removes the given element from the AutowiredContainer
 int size()
          Returns the size of the AutowiredContainer
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omnaest.utils.beans.autowired.AutowiredContainer
getValueSet, put, put, removeAllAssignableTo, removeAllHavingExactTypeOf
 
Methods inherited from interface java.lang.Iterable
iterator
 

Constructor Detail

AutowiredContainerAbstract

public AutowiredContainerAbstract()
Method Detail

getValue

public <O extends E> O getValue(Class<? extends O> clazz)
Description copied from interface: AutowiredContainer
Returns the value which can be assigned as value to the given Class type. If there are multiple values available with fitting types null is returned.

Specified by:
getValue in interface AutowiredContainer<E>
Returns:

putAll

public AutowiredContainer<E> putAll(Iterable<E> iterable)
Description copied from interface: AutowiredContainer
Adds multiple Objects to the AutowiredContainer.

Specified by:
putAll in interface AutowiredContainer<E>
Returns:
this
See Also:
AutowiredContainer.put(Object)

toString

public String toString()
Overrides:
toString in class Object

containsAssignable

public <O extends E> boolean containsAssignable(Class<O> type)
Description copied from interface: AutowiredContainer
Returns true if the current container contains any type which can be assigned to the given one.

Specified by:
containsAssignable in interface AutowiredContainer<E>
Returns:

isEmpty

public boolean isEmpty()
Description copied from interface: AutowiredContainer
Returns true if there are no elements within this container.

Specified by:
isEmpty in interface AutowiredContainer<E>
Returns:

remove

public <O extends E> AutowiredContainer<E> remove(O object)
Description copied from interface: AutowiredContainer
Removes the given element from the AutowiredContainer

Specified by:
remove in interface AutowiredContainer<E>
Returns:
this

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

size

public int size()
Description copied from interface: AutowiredContainer
Returns the size of the AutowiredContainer

Specified by:
size in interface AutowiredContainer<E>
Returns:


Copyright © 2013. All Rights Reserved.