|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unkrig.commons.lang.protocol.TransformerUtil
public final class TransformerUtil
Various Transformer-related utility methods.
| Method Summary | ||
|---|---|---|
static
|
addMappings(Transformer<I,O> transformer,
java.lang.Object... keysAndValues)
|
|
static
|
asTransformer(TransformerWhichThrows<? super I,? extends O,EX> source)
Converts a TransformerWhichThrows into a Transformer, which is possible iff:
The target's input type is a subclass of the source's input type, and
The source's output type is a subclass of the target's output type
The source's exception is a subclass of RuntimeException. |
|
static
|
asTransformerWhichThrows(Transformer<? super I,? extends O> source)
Converts a Transformer into a TransformerWhichThrows, which is possible iff:
The target's input type is a subclass of the source's input type, and
The source's output type is a subclass of the target's output type. |
|
static
|
combine(I extraInput,
O extraOutput,
Transformer<I,O> delegate)
|
|
static
|
combine(I extraInput,
O extraOutput,
TransformerWhichThrows<I,O,EX> delegate)
|
|
static
|
fromMappings(java.lang.Object... keysAndValues)
|
|
static
|
identity()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <O,I extends O> Transformer<I,O> identity()
Transformer that transforms any object reference to itself.public static <I,O,EX extends java.lang.Throwable> TransformerWhichThrows<I,O,EX> asTransformerWhichThrows(Transformer<? super I,? extends O> source)
Transformer into a TransformerWhichThrows, which is possible iff:
I - The transformers' input typeO - The transformers' output typeEX - The target transformer's exceptionpublic static <I,O,EX extends java.lang.RuntimeException> Transformer<I,O> asTransformer(TransformerWhichThrows<? super I,? extends O,EX> source)
TransformerWhichThrows into a Transformer, which is possible iff:
RuntimeException.
I - The transformers' input typeO - The transformers' output typeEX - The source transformer's exception
public static <I,O> Transformer<I,O> combine(I extraInput,
O extraOutput,
Transformer<I,O> delegate)
Transformer which calls the delegate, except when the subject equals the
extraInput, when it returns extraOutput
public static <I,O,EX extends java.lang.Exception> TransformerWhichThrows<I,O,EX> combine(I extraInput,
O extraOutput,
TransformerWhichThrows<I,O,EX> delegate)
TransformerWhichThrows which calls the delegate, except when the subject
equals the extraInput, when it returns extraOutput
public static <I,O> Transformer<I,O> addMappings(Transformer<I,O> transformer,
java.lang.Object... keysAndValues)
Transformer in which the given keys and values override the mappings of the delegate.public static <I,O> Transformer<I,O> fromMappings(java.lang.Object... keysAndValues)
Transformer in which the given keys and values override the mappings of the delegate.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||