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

io.activej.etcd.codec.value.EtcdValueCodec Maven / Gradle / Ivy

The newest version!
package io.activej.etcd.codec.value;

import io.activej.etcd.exception.MalformedEtcdDataException;
import io.etcd.jetcd.ByteSequence;

public interface EtcdValueCodec extends EtcdValueEncoder, EtcdValueDecoder {

	static  EtcdValueCodec of(EtcdValueEncoder encoder, EtcdValueDecoder decoder) {
		return new EtcdValueCodec<>() {
			@Override
			public ByteSequence encodeValue(V value) {
				return encoder.encodeValue(value);
			}

			@Override
			public V decodeValue(ByteSequence byteSequence) throws MalformedEtcdDataException {
				return decoder.decodeValue(byteSequence);
			}
		};
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy