1 16 package org.apache.commons.collections.functors; 17 18 import java.io.Serializable ; 19 20 import org.apache.commons.collections.Transformer; 21 22 32 public class CloneTransformer implements Transformer, Serializable { 33 34 35 static final long serialVersionUID = -8188742709499652567L; 36 37 38 public static final Transformer INSTANCE = new CloneTransformer(); 39 40 46 public static Transformer getInstance() { 47 return INSTANCE; 48 } 49 50 53 private CloneTransformer() { 54 super(); 55 } 56 57 63 public Object transform(Object input) { 64 if (input == null) { 65 return null; 66 } 67 return PrototypeFactory.getInstance(input).create(); 68 } 69 70 } 71 | Popular Tags |