com.obsidiandynamics.blackstrom.codec.MessageCodec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of blackstrom-core Show documentation
Show all versions of blackstrom-core Show documentation
Transactional event fabric for the JVM
The newest version!
package com.obsidiandynamics.blackstrom.codec;
import com.obsidiandynamics.blackstrom.model.*;
public interface MessageCodec {
int SCHEMA_VERSION = 2;
byte[] encode(Message message) throws Exception;
default String encodeText(Message message) throws Exception {
return new String(encode(message));
}
Message decode(byte[] bytes) throws Exception;
default Message decodeText(String text) throws Exception {
return decode(text.getBytes());
}
}