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, invokeCallbackOrReturn
public Function<SRC,SRC> decoder(Consumer<SRC> next)
Codec
public SRC apply(SRC src)
Function
src
- 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.Copyright © 2017. All rights reserved.