public class StringMessageCodec extends Object implements MessageCodec<String,String>
Constructor and Description |
---|
StringMessageCodec() |
Modifier and Type | Method and Description |
---|---|
String |
decodeFromWire(int pos,
Buffer buffer)
Called by Vert.x when a message is decoded from the wire.
|
void |
encodeToWire(Buffer buffer,
String s)
Called by Vert.x when marshalling a message to the wire.
|
String |
name()
The codec name.
|
byte |
systemCodecID()
Used to identify system codecs.
|
String |
transform(String s)
If a message is sent locally across the event bus, this method is called to transform the message from
the sent type S to the received type R
|
public void encodeToWire(Buffer buffer, String s)
MessageCodec
encodeToWire
in interface MessageCodec<String,String>
buffer
- the message should be written into this buffers
- the message that is being sentpublic String decodeFromWire(int pos, Buffer buffer)
MessageCodec
decodeFromWire
in interface MessageCodec<String,String>
pos
- the position in the buffer where the message should be read from.buffer
- the buffer to read the message frompublic String transform(String s)
MessageCodec
transform
in interface MessageCodec<String,String>
s
- the sent messagepublic String name()
MessageCodec
name
in interface MessageCodec<String,String>
public byte systemCodecID()
MessageCodec
systemCodecID
in interface MessageCodec<String,String>
Copyright © 2015. All Rights Reserved.