Top Description Fields Constructors Methods
org.apache.commons.collections4.functors

public Class CloneTransformer<T>

extends Object
implements Transformer<T, T>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.Transformer
Imports
org.apache.commons.collections4.Transformer

Transformer implementation that returns a clone of the input object.

Clone is performed using PrototypeFactory.prototypeFactory(input).create().

Warning

from v4.1 onwards this class will not be serializable anymore in order to prevent potential remote code execution exploits. Please refer to COLLECTIONS-580 for more details.

Since
3.0

Field Summary

Modifier and TypeField and Description
public static final Transformer<I, O>
INSTANCE

Singleton predicate instance

Constructor Summary

AccessConstructor and Description
private
CloneTransformer()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public static <
the type of the objects to be cloned
T
>
Transformer<T, T>

Returns:

the singleton instance
cloneTransformer
()

Factory returning the singleton instance.

public T

Returns:

the transformed result
transform
(final T
the input object to transform
input
)

Implements org.apache.commons.collections4.Transformer.transform.

Transforms the input to result by cloning it.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final Transformer<I, O> INSTANCE

Singleton predicate instance

Annotations
@SuppressWarnings:rawtypes

Constructor Detail

CloneTransformerback to summary
private CloneTransformer()

Constructor.

Method Detail

cloneTransformerback to summary
public static <T> Transformer<T, T> cloneTransformer()

Factory returning the singleton instance.

Parameters
<T>
the type of the objects to be cloned
Returns:Transformer<T, T>

the singleton instance

Since
3.1
transformback to summary
public T transform(final T input)

Implements org.apache.commons.collections4.Transformer.transform.

Transforms the input to result by cloning it.

Parameters
input:T

the input object to transform

Returns:T

the transformed result

Annotations
@Override