com.rethinkdb.gen.proto.Protocol Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of qj-rethinkdb-driver Show documentation
Show all versions of qj-rethinkdb-driver Show documentation
Java driver for RethinkDB (Modified from Official 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();
}
}
}