com.emarsys.ecommon.collections
Class GenericContainer
java.lang.Object
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
Method Summary |
|
getElem(java.lang.Class<T> klass)
|
|
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 |
GenericContainer
public GenericContainer()
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.