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

io.activej.etcd.codec.key.EtcdKeyCodec Maven / Gradle / Ivy

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

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

public interface EtcdKeyCodec extends EtcdKeyEncoder, EtcdKeyDecoder {

	static  EtcdKeyCodec of(EtcdKeyEncoder encoder, EtcdKeyDecoder decoder) {
		return new EtcdKeyCodec<>() {
			@Override
			public ByteSequence encodeKey(K key) {
				return encoder.encodeKey(key);
			}

			@Override
			public K decodeKey(ByteSequence byteSequence) throws MalformedEtcdDataException {
				return decoder.decodeKey(byteSequence);
			}
		};
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy