io.activej.etcd.codec.prefix.EtcdPrefixCodec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of activej-etcd Show documentation
Show all versions of activej-etcd Show documentation
Etcd Codecs, and transactional support for ActiveJ project.
The newest version!
package io.activej.etcd.codec.prefix;
import io.activej.etcd.exception.MalformedEtcdDataException;
import io.etcd.jetcd.ByteSequence;
public interface EtcdPrefixCodec extends EtcdPrefixEncoder, EtcdPrefixDecoder {
static EtcdPrefixCodec of(EtcdPrefixEncoder encoder, EtcdPrefixDecoder decoder) {
return new EtcdPrefixCodec<>() {
@Override
public ByteSequence encodePrefix(Prefix prefix) {
return encoder.encodePrefix(prefix);
}
@Override
public Prefix decodePrefix(ByteSequence byteSequence) throws MalformedEtcdDataException {
return decoder.decodePrefix(byteSequence);
}
};
}
}