Class PrototypeFactory.PrototypeCloneFactory<T>

java.lang.Object
org.apache.commons.collections4.functors.PrototypeFactory.PrototypeCloneFactory<T>
All Implemented Interfaces:
Factory<T>
Enclosing class:
PrototypeFactory

static class PrototypeFactory.PrototypeCloneFactory<T> extends Object implements Factory<T>
PrototypeCloneFactory creates objects by copying a prototype using the clone method.
  • Field Details

    • iPrototype

      private final T iPrototype
      The object to clone each time
    • iCloneMethod

      private transient Method iCloneMethod
      The method used to clone
  • Constructor Details

    • PrototypeCloneFactory

      private PrototypeCloneFactory(T prototype, Method method)
      Constructor to store prototype.
  • Method Details

    • findCloneMethod

      private void findCloneMethod()
      Find the Clone method for the class specified.
    • create

      public T create()
      Creates an object by calling the clone method.
      Specified by:
      create in interface Factory<T>
      Returns:
      the new object