All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.activej.etcd.codec.prefix.EtcdPrefixCodec Maven / Gradle / Ivy

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);
			}
		};
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy