1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15.functors.transformer;
17
18 import net.sf.collections15.Transformer;
19
20 import java.io.Serializable;
21
22 /***
23 * <code>Transformer</code> implementation that does nothing.
24 *
25 * @author Stephen Colebourne
26 * @author Chris Lambrou (port to Java 5.0)
27 * @since Collections15 1.0
28 */
29 public class NOPTransformer <E> implements Transformer<E, E>, Serializable
30 {
31
32 static final long serialVersionUID = 5564713373493429325L;
33
34 /***
35 * Returns an instance of <code>NOPTransformer</code>.
36 *
37 * @return An instance of <code>NOPTransformer</code>.
38 *
39 * @since Collections15 1.0
40 */
41 public static <T> NOPTransformer<T> getInstance()
42 {
43 return new NOPTransformer<T>();
44 }
45
46 /***
47 * Creates a new instance.
48 */
49 protected NOPTransformer()
50 {
51 }
52
53 /***
54 * Transforms the input to result by doing nothing.
55 *
56 * @param input The input object to transform.
57 *
58 * @return The input object.
59 */
60 public E transform(E input)
61 {
62 return input;
63 }
64
65 }