org.jjoost.util
Class Factories.CastFactory<E>

java.lang.Object
  extended by org.jjoost.util.Factories.CastFactory<E>
All Implemented Interfaces:
java.io.Serializable, Factory<E>
Enclosing class:
Factories

public static final class Factories.CastFactory<E>
extends java.lang.Object
implements Factory<E>

A simple factory which wraps another factory (ordinarily a SimpleObjectFactory) and (unsafely) casts the result to the type parameter provided.

Author:
b.elliottsmith
See Also:
Serialized Form

Constructor Summary
Factories.CastFactory(Factory<?> wrapped)
          Create a new cast factory
 
Method Summary
 E create()
          Returns an object of type E.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factories.CastFactory

public Factories.CastFactory(Factory<?> wrapped)
Create a new cast factory

Parameters:
wrapped - the factory to delegate creation to
Method Detail

create

public E create()
Description copied from interface: Factory
Returns an object of type E. This method should be thread-safe.

Specified by:
create in interface Factory<E>
Returns:
an object of type E