public class PassThroughCodec<SRC> extends java.lang.Object implements Codec<SRC,SRC,SRC>
Codec that uses the source object as both input and output. Override the beforeAccept(Object) and beforeApply(Object) methods to intercept data coming in and going out
(respectively).| Constructor and Description |
|---|
PassThroughCodec() |
| Modifier and Type | Method and Description |
|---|---|
protected SRC |
beforeAccept(SRC src)
|
protected SRC |
beforeApply(SRC src)
Override to intercept the source object before it is returned for output.
|
Function<SRC,SRC> |
decoder(Consumer<SRC> next)
Provide the caller with a decoder to turn a source object into an instance of the input
type.
|
Function<SRC,SRC> |
encoder()
Provide the caller with an encoder to turn an output object into an instance of the source
type.
|
public Function<SRC,SRC> decoder(Consumer<SRC> next)
Codecpublic Function<SRC,SRC> encoder()
Codecprotected SRC beforeAccept(SRC src)
Consumer or
returned to the caller if a Consumer is not set.src - The source object.