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

com.rethinkdb.gen.proto.Protocol Maven / Gradle / Ivy

There is a newer version: 2.3.2.20160729
Show newest version
// Autogenerated by metajava.py.
// Do not edit this file directly.
// The template for this file is located at:
// ../../../../../../../../templates/Enum.java

package com.rethinkdb.gen.proto;

import java.util.Optional;

public enum Protocol {

    PROTOBUF(656407617),
    JSON(2120839367);

    public final int value;

    private Protocol(int value){
        this.value = value;
    }

    public static Protocol fromValue(int value) {
        switch (value) {
            case 656407617: return Protocol.PROTOBUF;
            case 2120839367: return Protocol.JSON;
            default:
                throw new IllegalArgumentException(String.format(
                "%s is not a legal value for Protocol", value));
        }
    }

    public static Optional maybeFromValue(int value) {
        try {
            return Optional.of(fromValue(value));
        } catch (IllegalArgumentException iae) {
            return Optional.empty();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy