public class PrototypeFactory extends Object
public static <T> Factory<T> prototypeFactory(T prototype)
Creates a Factory that will return a clone of the same prototype object each time the factory is used. The prototype will be cloned using one of these techniques (in order):
T
- the type the factory createsprototype
- the object to clone each time in the factoryprototype
factory, or a ConstantFactory.NULL_INSTANCE
if
the prototype
is null
IllegalArgumentException
- if the prototype cannot be clonedCopyright © 2001–2013 The Apache Software Foundation. All rights reserved.