|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
U - T - public interface Decoder<U,T>
A decoder can be used to 'decode' the response's body. Decoder's can be used to decode the response body and match them with Function's implementation.
This library will try to match the decoded Object to its associated Function. For example, the Decoder's type will
be mapped, by the FunctionResolver to the Function of the same type if no function message has been defined:
Decoder<String, POJO> d = new Decoder<String, POJO>() {
@Override
public POJO decode(Event e, String s) {
return new POJO(s);
}
}
Important: Decoder cannot be chained, e.g the result of a Decoder will never be passed to another Decoder, like Encoder
| Nested Class Summary | |
|---|---|
static class |
Decoder.Decoded<T>
A Decoder may return an instance of a Decoded object to prevent some messages from being delivered to a Function,
by returning a Decoder.Decoded.ABORT instance. |
| Method Summary | |
|---|---|
T |
decode(Event e,
U s)
Decode the specified object of type U into object of type T. |
| Method Detail |
|---|
T decode(Event e,
U s)
e - an Event type. This can be used to differentiate event received.s - a object of type U
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||