com.emarsys.ecommon.collections
Class GenericContainer

java.lang.Object
  extended by com.emarsys.ecommon.collections.GenericContainer

public class GenericContainer
extends java.lang.Object

GenericContainer implements a Typesafe Heterogeneous Container.
Typically, containers are parameterized, this Limits you to a fixed number of type parameters when you sometimes may need more flexibility (DB rows, type-based publish-subscribe, etc.)
GenericContainer parameterizes the selector to the container. The data is strongly typed at compile time. This effectively allows unlimited type parameters
The class is inspired by an article from Joshua Bloch.

Author:
Michael "kULO" Kulovits

Constructor Summary
GenericContainer()
           
 
Method Summary
<T> T
getElem(java.lang.Class<T> klass)
           
<T> void
setElem(java.lang.Class<T> klass, T thing)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericContainer

public GenericContainer()
Method Detail

setElem

public <T> void setElem(java.lang.Class<T> klass,
                        T thing)

getElem

public <T> T getElem(java.lang.Class<T> klass)


Copyright © 2010 emarsys AG. All Rights Reserved.