Class AbstractTransformer<E,W>
java.lang.Object
com.aoapps.collections.transformers.AbstractTransformer<E,W>
- Type Parameters:
E
- The wrapper typeW
- The wrapped type
- All Implemented Interfaces:
Transformer<E,
W>
- Direct Known Subclasses:
FunctionalTransformer
Performs type conversions between two classes.
- Author:
- AO Industries, Inc.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractTransformer
(Class<E> eClass, Class<W> wClass) Creates a new type converter. -
Method Summary
Modifier and TypeMethodDescriptionabstract E
fromWrapped
(W w) invert()
abstract W
Gets a transformer that wraps and unwraps only when elements are of the wrapper or wrapped types, respectively.
-
Field Details
-
eClass
-
wClass
-
inverted
-
-
Constructor Details
-
AbstractTransformer
Creates a new type converter.- Parameters:
eClass
- The wrapper typewClass
- The wrapped type
-
-
Method Details
-
toWrapped
- Specified by:
toWrapped
in interfaceTransformer<E,
W>
-
fromWrapped
- Specified by:
fromWrapped
in interfaceTransformer<E,
W>
-
unbounded
Description copied from interface:Transformer
Gets a transformer that wraps and unwraps only when elements are of the wrapper or wrapped types, respectively. This is useful for legacy APIs that useObject
or unbounded generics, such as:- Specified by:
unbounded
in interfaceTransformer<E,
W>
-
invert
- Specified by:
invert
in interfaceTransformer<E,
W>
-