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

io.elastic.sailor.impl.MessageEncoding Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package io.elastic.sailor.impl;

public enum MessageEncoding {
    UTF8(2), BASE64(1);

    public final int protocolVersion;

    MessageEncoding(int protocolVersion) {
        this.protocolVersion = protocolVersion;
    }

    public static MessageEncoding fromProtocolVersion(final int version) {
        for (MessageEncoding e : values()) {
            if (e.protocolVersion == version) {
                return e;
            }
        }

        throw new IllegalArgumentException("Unknown protocol version");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy