public class PassThroughCodec<SRC> extends 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).DEFAULT_DELIMITER, delimiter| Constructor and Description |
|---|
PassThroughCodec() |
| Modifier and Type | Method and Description |
|---|---|
SRC |
apply(SRC src)
Execute the logic of the action, accepting the given parameter.
|
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.
|
addDelimiterIfAny, decode, decoder, doBufferDecode, doDelimitedBufferDecode, encode, encoder, invokeCallbackOrReturnpublic Function<SRC,SRC> decoder(Consumer<SRC> next)
Codecpublic SRC apply(SRC src)
Functionsrc - The parameter to pass to the action.protected SRC beforeAccept(SRC src)
Consumer or
returned to the caller if a Consumer is not set.src - The source object.