/**
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.riksa.bombah.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BombahService {
public interface Iface {
public String ping() throws org.apache.thrift.TException;
/**
* Event from controller
*
* @param playerId
* @param controllerState
*/
public ControllerResult controllerEvent(int playerId, ControllerState controllerState) throws YouAreDeadException, GameOverException, org.apache.thrift.TException;
public MoveActionResult move(int playerId, MoveAction moveAction) throws YouAreDeadException, GameOverException, org.apache.thrift.TException;
public BombActionResult bomb(int playerId, BombAction bombAction) throws YouAreDeadException, GameOverException, org.apache.thrift.TException;
public MapState waitTicks(int gameId, int ticks) throws YouAreDeadException, GameOverException, org.apache.thrift.TException;
public MapState waitForTick(int gameId, int tick) throws YouAreDeadException, GameOverException, org.apache.thrift.TException;
public GameInfo joinGame(int gameId, String username, String clientname) throws GameOverException, org.apache.thrift.TException;
public GameInfo getGameInfo(int gameId) throws GameOverException, org.apache.thrift.TException;
public void debugResetGame(int gameId) throws org.apache.thrift.TException;
public void waitForStart(int gameId) throws GameOverException, org.apache.thrift.TException;
public MapState getMapState(int gameId) throws GameOverException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void ping(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.ping_call> resultHandler) throws org.apache.thrift.TException;
public void controllerEvent(int playerId, ControllerState controllerState, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.controllerEvent_call> resultHandler) throws org.apache.thrift.TException;
public void move(int playerId, MoveAction moveAction, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.move_call> resultHandler) throws org.apache.thrift.TException;
public void bomb(int playerId, BombAction bombAction, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.bomb_call> resultHandler) throws org.apache.thrift.TException;
public void waitTicks(int gameId, int ticks, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.waitTicks_call> resultHandler) throws org.apache.thrift.TException;
public void waitForTick(int gameId, int tick, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.waitForTick_call> resultHandler) throws org.apache.thrift.TException;
public void joinGame(int gameId, String username, String clientname, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.joinGame_call> resultHandler) throws org.apache.thrift.TException;
public void getGameInfo(int gameId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getGameInfo_call> resultHandler) throws org.apache.thrift.TException;
public void debugResetGame(int gameId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.debugResetGame_call> resultHandler) throws org.apache.thrift.TException;
public void waitForStart(int gameId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.waitForStart_call> resultHandler) throws org.apache.thrift.TException;
public void getMapState(int gameId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getMapState_call> resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public String ping() throws org.apache.thrift.TException
{
send_ping();
return recv_ping();
}
public void send_ping() throws org.apache.thrift.TException
{
ping_args args = new ping_args();
sendBase("ping", args);
}
public String recv_ping() throws org.apache.thrift.TException
{
ping_result result = new ping_result();
receiveBase(result, "ping");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ping failed: unknown result");
}
public ControllerResult controllerEvent(int playerId, ControllerState controllerState) throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
send_controllerEvent(playerId, controllerState);
return recv_controllerEvent();
}
public void send_controllerEvent(int playerId, ControllerState controllerState) throws org.apache.thrift.TException
{
controllerEvent_args args = new controllerEvent_args();
args.setPlayerId(playerId);
args.setControllerState(controllerState);
sendBase("controllerEvent", args);
}
public ControllerResult recv_controllerEvent() throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
controllerEvent_result result = new controllerEvent_result();
receiveBase(result, "controllerEvent");
if (result.isSetSuccess()) {
return result.success;
}
if (result.youAreDead != null) {
throw result.youAreDead;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "controllerEvent failed: unknown result");
}
public MoveActionResult move(int playerId, MoveAction moveAction) throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
send_move(playerId, moveAction);
return recv_move();
}
public void send_move(int playerId, MoveAction moveAction) throws org.apache.thrift.TException
{
move_args args = new move_args();
args.setPlayerId(playerId);
args.setMoveAction(moveAction);
sendBase("move", args);
}
public MoveActionResult recv_move() throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
move_result result = new move_result();
receiveBase(result, "move");
if (result.isSetSuccess()) {
return result.success;
}
if (result.youAreDead != null) {
throw result.youAreDead;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "move failed: unknown result");
}
public BombActionResult bomb(int playerId, BombAction bombAction) throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
send_bomb(playerId, bombAction);
return recv_bomb();
}
public void send_bomb(int playerId, BombAction bombAction) throws org.apache.thrift.TException
{
bomb_args args = new bomb_args();
args.setPlayerId(playerId);
args.setBombAction(bombAction);
sendBase("bomb", args);
}
public BombActionResult recv_bomb() throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
bomb_result result = new bomb_result();
receiveBase(result, "bomb");
if (result.isSetSuccess()) {
return result.success;
}
if (result.youAreDead != null) {
throw result.youAreDead;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "bomb failed: unknown result");
}
public MapState waitTicks(int gameId, int ticks) throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
send_waitTicks(gameId, ticks);
return recv_waitTicks();
}
public void send_waitTicks(int gameId, int ticks) throws org.apache.thrift.TException
{
waitTicks_args args = new waitTicks_args();
args.setGameId(gameId);
args.setTicks(ticks);
sendBase("waitTicks", args);
}
public MapState recv_waitTicks() throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
waitTicks_result result = new waitTicks_result();
receiveBase(result, "waitTicks");
if (result.isSetSuccess()) {
return result.success;
}
if (result.youAreDead != null) {
throw result.youAreDead;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "waitTicks failed: unknown result");
}
public MapState waitForTick(int gameId, int tick) throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
send_waitForTick(gameId, tick);
return recv_waitForTick();
}
public void send_waitForTick(int gameId, int tick) throws org.apache.thrift.TException
{
waitForTick_args args = new waitForTick_args();
args.setGameId(gameId);
args.setTick(tick);
sendBase("waitForTick", args);
}
public MapState recv_waitForTick() throws YouAreDeadException, GameOverException, org.apache.thrift.TException
{
waitForTick_result result = new waitForTick_result();
receiveBase(result, "waitForTick");
if (result.isSetSuccess()) {
return result.success;
}
if (result.youAreDead != null) {
throw result.youAreDead;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "waitForTick failed: unknown result");
}
public GameInfo joinGame(int gameId, String username, String clientname) throws GameOverException, org.apache.thrift.TException
{
send_joinGame(gameId, username, clientname);
return recv_joinGame();
}
public void send_joinGame(int gameId, String username, String clientname) throws org.apache.thrift.TException
{
joinGame_args args = new joinGame_args();
args.setGameId(gameId);
args.setUsername(username);
args.setClientname(clientname);
sendBase("joinGame", args);
}
public GameInfo recv_joinGame() throws GameOverException, org.apache.thrift.TException
{
joinGame_result result = new joinGame_result();
receiveBase(result, "joinGame");
if (result.isSetSuccess()) {
return result.success;
}
if (result.gameOverException != null) {
throw result.gameOverException;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "joinGame failed: unknown result");
}
public GameInfo getGameInfo(int gameId) throws GameOverException, org.apache.thrift.TException
{
send_getGameInfo(gameId);
return recv_getGameInfo();
}
public void send_getGameInfo(int gameId) throws org.apache.thrift.TException
{
getGameInfo_args args = new getGameInfo_args();
args.setGameId(gameId);
sendBase("getGameInfo", args);
}
public GameInfo recv_getGameInfo() throws GameOverException, org.apache.thrift.TException
{
getGameInfo_result result = new getGameInfo_result();
receiveBase(result, "getGameInfo");
if (result.isSetSuccess()) {
return result.success;
}
if (result.gameOverException != null) {
throw result.gameOverException;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getGameInfo failed: unknown result");
}
public void debugResetGame(int gameId) throws org.apache.thrift.TException
{
send_debugResetGame(gameId);
recv_debugResetGame();
}
public void send_debugResetGame(int gameId) throws org.apache.thrift.TException
{
debugResetGame_args args = new debugResetGame_args();
args.setGameId(gameId);
sendBase("debugResetGame", args);
}
public void recv_debugResetGame() throws org.apache.thrift.TException
{
debugResetGame_result result = new debugResetGame_result();
receiveBase(result, "debugResetGame");
return;
}
public void waitForStart(int gameId) throws GameOverException, org.apache.thrift.TException
{
send_waitForStart(gameId);
recv_waitForStart();
}
public void send_waitForStart(int gameId) throws org.apache.thrift.TException
{
waitForStart_args args = new waitForStart_args();
args.setGameId(gameId);
sendBase("waitForStart", args);
}
public void recv_waitForStart() throws GameOverException, org.apache.thrift.TException
{
waitForStart_result result = new waitForStart_result();
receiveBase(result, "waitForStart");
if (result.gameOverException != null) {
throw result.gameOverException;
}
return;
}
public MapState getMapState(int gameId) throws GameOverException, org.apache.thrift.TException
{
send_getMapState(gameId);
return recv_getMapState();
}
public void send_getMapState(int gameId) throws org.apache.thrift.TException
{
getMapState_args args = new getMapState_args();
args.setGameId(gameId);
sendBase("getMapState", args);
}
public MapState recv_getMapState() throws GameOverException, org.apache.thrift.TException
{
getMapState_result result = new getMapState_result();
receiveBase(result, "getMapState");
if (result.isSetSuccess()) {
return result.success;
}
if (result.gameOver != null) {
throw result.gameOver;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMapState failed: unknown result");
}
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void ping(org.apache.thrift.async.AsyncMethodCallback<ping_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
ping_call method_call = new ping_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class ping_call extends org.apache.thrift.async.TAsyncMethodCall {
public ping_call(org.apache.thrift.async.AsyncMethodCallback<ping_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ping", org.apache.thrift.protocol.TMessageType.CALL, 0));
ping_args args = new ping_args();
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_ping();
}
}
public void controllerEvent(int playerId, ControllerState controllerState, org.apache.thrift.async.AsyncMethodCallback<controllerEvent_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
controllerEvent_call method_call = new controllerEvent_call(playerId, controllerState, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class controllerEvent_call extends org.apache.thrift.async.TAsyncMethodCall {
private int playerId;
private ControllerState controllerState;
public controllerEvent_call(int playerId, ControllerState controllerState, org.apache.thrift.async.AsyncMethodCallback<controllerEvent_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.playerId = playerId;
this.controllerState = controllerState;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("controllerEvent", org.apache.thrift.protocol.TMessageType.CALL, 0));
controllerEvent_args args = new controllerEvent_args();
args.setPlayerId(playerId);
args.setControllerState(controllerState);
args.write(prot);
prot.writeMessageEnd();
}
public ControllerResult getResult() throws YouAreDeadException, GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_controllerEvent();
}
}
public void move(int playerId, MoveAction moveAction, org.apache.thrift.async.AsyncMethodCallback<move_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
move_call method_call = new move_call(playerId, moveAction, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class move_call extends org.apache.thrift.async.TAsyncMethodCall {
private int playerId;
private MoveAction moveAction;
public move_call(int playerId, MoveAction moveAction, org.apache.thrift.async.AsyncMethodCallback<move_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.playerId = playerId;
this.moveAction = moveAction;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("move", org.apache.thrift.protocol.TMessageType.CALL, 0));
move_args args = new move_args();
args.setPlayerId(playerId);
args.setMoveAction(moveAction);
args.write(prot);
prot.writeMessageEnd();
}
public MoveActionResult getResult() throws YouAreDeadException, GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_move();
}
}
public void bomb(int playerId, BombAction bombAction, org.apache.thrift.async.AsyncMethodCallback<bomb_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
bomb_call method_call = new bomb_call(playerId, bombAction, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class bomb_call extends org.apache.thrift.async.TAsyncMethodCall {
private int playerId;
private BombAction bombAction;
public bomb_call(int playerId, BombAction bombAction, org.apache.thrift.async.AsyncMethodCallback<bomb_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.playerId = playerId;
this.bombAction = bombAction;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("bomb", org.apache.thrift.protocol.TMessageType.CALL, 0));
bomb_args args = new bomb_args();
args.setPlayerId(playerId);
args.setBombAction(bombAction);
args.write(prot);
prot.writeMessageEnd();
}
public BombActionResult getResult() throws YouAreDeadException, GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_bomb();
}
}
public void waitTicks(int gameId, int ticks, org.apache.thrift.async.AsyncMethodCallback<waitTicks_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
waitTicks_call method_call = new waitTicks_call(gameId, ticks, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class waitTicks_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
private int ticks;
public waitTicks_call(int gameId, int ticks, org.apache.thrift.async.AsyncMethodCallback<waitTicks_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
this.ticks = ticks;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("waitTicks", org.apache.thrift.protocol.TMessageType.CALL, 0));
waitTicks_args args = new waitTicks_args();
args.setGameId(gameId);
args.setTicks(ticks);
args.write(prot);
prot.writeMessageEnd();
}
public MapState getResult() throws YouAreDeadException, GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_waitTicks();
}
}
public void waitForTick(int gameId, int tick, org.apache.thrift.async.AsyncMethodCallback<waitForTick_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
waitForTick_call method_call = new waitForTick_call(gameId, tick, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class waitForTick_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
private int tick;
public waitForTick_call(int gameId, int tick, org.apache.thrift.async.AsyncMethodCallback<waitForTick_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
this.tick = tick;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("waitForTick", org.apache.thrift.protocol.TMessageType.CALL, 0));
waitForTick_args args = new waitForTick_args();
args.setGameId(gameId);
args.setTick(tick);
args.write(prot);
prot.writeMessageEnd();
}
public MapState getResult() throws YouAreDeadException, GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_waitForTick();
}
}
public void joinGame(int gameId, String username, String clientname, org.apache.thrift.async.AsyncMethodCallback<joinGame_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
joinGame_call method_call = new joinGame_call(gameId, username, clientname, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class joinGame_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
private String username;
private String clientname;
public joinGame_call(int gameId, String username, String clientname, org.apache.thrift.async.AsyncMethodCallback<joinGame_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
this.username = username;
this.clientname = clientname;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("joinGame", org.apache.thrift.protocol.TMessageType.CALL, 0));
joinGame_args args = new joinGame_args();
args.setGameId(gameId);
args.setUsername(username);
args.setClientname(clientname);
args.write(prot);
prot.writeMessageEnd();
}
public GameInfo getResult() throws GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_joinGame();
}
}
public void getGameInfo(int gameId, org.apache.thrift.async.AsyncMethodCallback<getGameInfo_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
getGameInfo_call method_call = new getGameInfo_call(gameId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getGameInfo_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
public getGameInfo_call(int gameId, org.apache.thrift.async.AsyncMethodCallback<getGameInfo_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getGameInfo", org.apache.thrift.protocol.TMessageType.CALL, 0));
getGameInfo_args args = new getGameInfo_args();
args.setGameId(gameId);
args.write(prot);
prot.writeMessageEnd();
}
public GameInfo getResult() throws GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getGameInfo();
}
}
public void debugResetGame(int gameId, org.apache.thrift.async.AsyncMethodCallback<debugResetGame_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
debugResetGame_call method_call = new debugResetGame_call(gameId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class debugResetGame_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
public debugResetGame_call(int gameId, org.apache.thrift.async.AsyncMethodCallback<debugResetGame_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("debugResetGame", org.apache.thrift.protocol.TMessageType.CALL, 0));
debugResetGame_args args = new debugResetGame_args();
args.setGameId(gameId);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_debugResetGame();
}
}
public void waitForStart(int gameId, org.apache.thrift.async.AsyncMethodCallback<waitForStart_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
waitForStart_call method_call = new waitForStart_call(gameId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class waitForStart_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
public waitForStart_call(int gameId, org.apache.thrift.async.AsyncMethodCallback<waitForStart_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("waitForStart", org.apache.thrift.protocol.TMessageType.CALL, 0));
waitForStart_args args = new waitForStart_args();
args.setGameId(gameId);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_waitForStart();
}
}
public void getMapState(int gameId, org.apache.thrift.async.AsyncMethodCallback<getMapState_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
getMapState_call method_call = new getMapState_call(gameId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getMapState_call extends org.apache.thrift.async.TAsyncMethodCall {
private int gameId;
public getMapState_call(int gameId, org.apache.thrift.async.AsyncMethodCallback<getMapState_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.gameId = gameId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMapState", org.apache.thrift.protocol.TMessageType.CALL, 0));
getMapState_args args = new getMapState_args();
args.setGameId(gameId);
args.write(prot);
prot.writeMessageEnd();
}
public MapState getResult() throws GameOverException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getMapState();
}
}
}
public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
}
protected Processor(I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
processMap.put("ping", new ping());
processMap.put("controllerEvent", new controllerEvent());
processMap.put("move", new move());
processMap.put("bomb", new bomb());
processMap.put("waitTicks", new waitTicks());
processMap.put("waitForTick", new waitForTick());
processMap.put("joinGame", new joinGame());
processMap.put("getGameInfo", new getGameInfo());
processMap.put("debugResetGame", new debugResetGame());
processMap.put("waitForStart", new waitForStart());
processMap.put("getMapState", new getMapState());
return processMap;
}
private static class ping<I extends Iface> extends org.apache.thrift.ProcessFunction<I, ping_args> {
public ping() {
super("ping");
}
protected ping_args getEmptyArgsInstance() {
return new ping_args();
}
protected ping_result getResult(I iface, ping_args args) throws org.apache.thrift.TException {
ping_result result = new ping_result();
result.success = iface.ping();
return result;
}
}
private static class controllerEvent<I extends Iface> extends org.apache.thrift.ProcessFunction<I, controllerEvent_args> {
public controllerEvent() {
super("controllerEvent");
}
protected controllerEvent_args getEmptyArgsInstance() {
return new controllerEvent_args();
}
protected controllerEvent_result getResult(I iface, controllerEvent_args args) throws org.apache.thrift.TException {
controllerEvent_result result = new controllerEvent_result();
try {
result.success = iface.controllerEvent(args.playerId, args.controllerState);
} catch (YouAreDeadException youAreDead) {
result.youAreDead = youAreDead;
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
private static class move<I extends Iface> extends org.apache.thrift.ProcessFunction<I, move_args> {
public move() {
super("move");
}
protected move_args getEmptyArgsInstance() {
return new move_args();
}
protected move_result getResult(I iface, move_args args) throws org.apache.thrift.TException {
move_result result = new move_result();
try {
result.success = iface.move(args.playerId, args.moveAction);
} catch (YouAreDeadException youAreDead) {
result.youAreDead = youAreDead;
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
private static class bomb<I extends Iface> extends org.apache.thrift.ProcessFunction<I, bomb_args> {
public bomb() {
super("bomb");
}
protected bomb_args getEmptyArgsInstance() {
return new bomb_args();
}
protected bomb_result getResult(I iface, bomb_args args) throws org.apache.thrift.TException {
bomb_result result = new bomb_result();
try {
result.success = iface.bomb(args.playerId, args.bombAction);
} catch (YouAreDeadException youAreDead) {
result.youAreDead = youAreDead;
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
private static class waitTicks<I extends Iface> extends org.apache.thrift.ProcessFunction<I, waitTicks_args> {
public waitTicks() {
super("waitTicks");
}
protected waitTicks_args getEmptyArgsInstance() {
return new waitTicks_args();
}
protected waitTicks_result getResult(I iface, waitTicks_args args) throws org.apache.thrift.TException {
waitTicks_result result = new waitTicks_result();
try {
result.success = iface.waitTicks(args.gameId, args.ticks);
} catch (YouAreDeadException youAreDead) {
result.youAreDead = youAreDead;
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
private static class waitForTick<I extends Iface> extends org.apache.thrift.ProcessFunction<I, waitForTick_args> {
public waitForTick() {
super("waitForTick");
}
protected waitForTick_args getEmptyArgsInstance() {
return new waitForTick_args();
}
protected waitForTick_result getResult(I iface, waitForTick_args args) throws org.apache.thrift.TException {
waitForTick_result result = new waitForTick_result();
try {
result.success = iface.waitForTick(args.gameId, args.tick);
} catch (YouAreDeadException youAreDead) {
result.youAreDead = youAreDead;
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
private static class joinGame<I extends Iface> extends org.apache.thrift.ProcessFunction<I, joinGame_args> {
public joinGame() {
super("joinGame");
}
protected joinGame_args getEmptyArgsInstance() {
return new joinGame_args();
}
protected joinGame_result getResult(I iface, joinGame_args args) throws org.apache.thrift.TException {
joinGame_result result = new joinGame_result();
try {
result.success = iface.joinGame(args.gameId, args.username, args.clientname);
} catch (GameOverException gameOverException) {
result.gameOverException = gameOverException;
}
return result;
}
}
private static class getGameInfo<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getGameInfo_args> {
public getGameInfo() {
super("getGameInfo");
}
protected getGameInfo_args getEmptyArgsInstance() {
return new getGameInfo_args();
}
protected getGameInfo_result getResult(I iface, getGameInfo_args args) throws org.apache.thrift.TException {
getGameInfo_result result = new getGameInfo_result();
try {
result.success = iface.getGameInfo(args.gameId);
} catch (GameOverException gameOverException) {
result.gameOverException = gameOverException;
}
return result;
}
}
private static class debugResetGame<I extends Iface> extends org.apache.thrift.ProcessFunction<I, debugResetGame_args> {
public debugResetGame() {
super("debugResetGame");
}
protected debugResetGame_args getEmptyArgsInstance() {
return new debugResetGame_args();
}
protected debugResetGame_result getResult(I iface, debugResetGame_args args) throws org.apache.thrift.TException {
debugResetGame_result result = new debugResetGame_result();
iface.debugResetGame(args.gameId);
return result;
}
}
private static class waitForStart<I extends Iface> extends org.apache.thrift.ProcessFunction<I, waitForStart_args> {
public waitForStart() {
super("waitForStart");
}
protected waitForStart_args getEmptyArgsInstance() {
return new waitForStart_args();
}
protected waitForStart_result getResult(I iface, waitForStart_args args) throws org.apache.thrift.TException {
waitForStart_result result = new waitForStart_result();
try {
iface.waitForStart(args.gameId);
} catch (GameOverException gameOverException) {
result.gameOverException = gameOverException;
}
return result;
}
}
private static class getMapState<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getMapState_args> {
public getMapState() {
super("getMapState");
}
protected getMapState_args getEmptyArgsInstance() {
return new getMapState_args();
}
protected getMapState_result getResult(I iface, getMapState_args args) throws org.apache.thrift.TException {
getMapState_result result = new getMapState_result();
try {
result.success = iface.getMapState(args.gameId);
} catch (GameOverException gameOver) {
result.gameOver = gameOver;
}
return result;
}
}
}
public static class ping_args implements org.apache.thrift.TBase<ping_args, ping_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_args");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ping_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new ping_argsTupleSchemeFactory());
}
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_args.class, metaDataMap);
}
public ping_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ping_args(ping_args other) {
}
public ping_args deepCopy() {
return new ping_args(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ping_args)
return this.equals((ping_args)that);
return false;
}
public boolean equals(ping_args that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(ping_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ping_args typedOther = (ping_args)other;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ping_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ping_argsStandardSchemeFactory implements SchemeFactory {
public ping_argsStandardScheme getScheme() {
return new ping_argsStandardScheme();
}
}
private static class ping_argsStandardScheme extends StandardScheme<ping_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ping_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ping_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ping_argsTupleSchemeFactory implements SchemeFactory {
public ping_argsTupleScheme getScheme() {
return new ping_argsTupleScheme();
}
}
private static class ping_argsTupleScheme extends TupleScheme<ping_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ping_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
public static class ping_result implements org.apache.thrift.TBase<ping_result, ping_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ping_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new ping_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new ping_resultTupleSchemeFactory());
}
public String success; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ping_result.class, metaDataMap);
}
public ping_result() {
}
public ping_result(
String success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public ping_result(ping_result other) {
if (other.isSetSuccess()) {
this.success = other.success;
}
}
public ping_result deepCopy() {
return new ping_result(this);
}
@Override
public void clear() {
this.success = null;
}
public String getSuccess() {
return this.success;
}
public ping_result setSuccess(String success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof ping_result)
return this.equals((ping_result)that);
return false;
}
public boolean equals(ping_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(ping_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
ping_result typedOther = (ping_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ping_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class ping_resultStandardSchemeFactory implements SchemeFactory {
public ping_resultStandardScheme getScheme() {
return new ping_resultStandardScheme();
}
}
private static class ping_resultStandardScheme extends StandardScheme<ping_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, ping_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, ping_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeString(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class ping_resultTupleSchemeFactory implements SchemeFactory {
public ping_resultTupleScheme getScheme() {
return new ping_resultTupleScheme();
}
}
private static class ping_resultTupleScheme extends TupleScheme<ping_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetSuccess()) {
oprot.writeString(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, ping_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readString();
struct.setSuccessIsSet(true);
}
}
}
}
public static class controllerEvent_args implements org.apache.thrift.TBase<controllerEvent_args, controllerEvent_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("controllerEvent_args");
private static final org.apache.thrift.protocol.TField PLAYER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("playerId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField CONTROLLER_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("controllerState", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new controllerEvent_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new controllerEvent_argsTupleSchemeFactory());
}
public int playerId; // required
public ControllerState controllerState; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PLAYER_ID((short)1, "playerId"),
CONTROLLER_STATE((short)2, "controllerState");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PLAYER_ID
return PLAYER_ID;
case 2: // CONTROLLER_STATE
return CONTROLLER_STATE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __PLAYERID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PLAYER_ID, new org.apache.thrift.meta_data.FieldMetaData("playerId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.CONTROLLER_STATE, new org.apache.thrift.meta_data.FieldMetaData("controllerState", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ControllerState.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(controllerEvent_args.class, metaDataMap);
}
public controllerEvent_args() {
}
public controllerEvent_args(
int playerId,
ControllerState controllerState)
{
this();
this.playerId = playerId;
setPlayerIdIsSet(true);
this.controllerState = controllerState;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public controllerEvent_args(controllerEvent_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.playerId = other.playerId;
if (other.isSetControllerState()) {
this.controllerState = new ControllerState(other.controllerState);
}
}
public controllerEvent_args deepCopy() {
return new controllerEvent_args(this);
}
@Override
public void clear() {
setPlayerIdIsSet(false);
this.playerId = 0;
this.controllerState = null;
}
public int getPlayerId() {
return this.playerId;
}
public controllerEvent_args setPlayerId(int playerId) {
this.playerId = playerId;
setPlayerIdIsSet(true);
return this;
}
public void unsetPlayerId() {
__isset_bit_vector.clear(__PLAYERID_ISSET_ID);
}
/** Returns true if field playerId is set (has been assigned a value) and false otherwise */
public boolean isSetPlayerId() {
return __isset_bit_vector.get(__PLAYERID_ISSET_ID);
}
public void setPlayerIdIsSet(boolean value) {
__isset_bit_vector.set(__PLAYERID_ISSET_ID, value);
}
public ControllerState getControllerState() {
return this.controllerState;
}
public controllerEvent_args setControllerState(ControllerState controllerState) {
this.controllerState = controllerState;
return this;
}
public void unsetControllerState() {
this.controllerState = null;
}
/** Returns true if field controllerState is set (has been assigned a value) and false otherwise */
public boolean isSetControllerState() {
return this.controllerState != null;
}
public void setControllerStateIsSet(boolean value) {
if (!value) {
this.controllerState = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PLAYER_ID:
if (value == null) {
unsetPlayerId();
} else {
setPlayerId((Integer)value);
}
break;
case CONTROLLER_STATE:
if (value == null) {
unsetControllerState();
} else {
setControllerState((ControllerState)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PLAYER_ID:
return Integer.valueOf(getPlayerId());
case CONTROLLER_STATE:
return getControllerState();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PLAYER_ID:
return isSetPlayerId();
case CONTROLLER_STATE:
return isSetControllerState();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof controllerEvent_args)
return this.equals((controllerEvent_args)that);
return false;
}
public boolean equals(controllerEvent_args that) {
if (that == null)
return false;
boolean this_present_playerId = true;
boolean that_present_playerId = true;
if (this_present_playerId || that_present_playerId) {
if (!(this_present_playerId && that_present_playerId))
return false;
if (this.playerId != that.playerId)
return false;
}
boolean this_present_controllerState = true && this.isSetControllerState();
boolean that_present_controllerState = true && that.isSetControllerState();
if (this_present_controllerState || that_present_controllerState) {
if (!(this_present_controllerState && that_present_controllerState))
return false;
if (!this.controllerState.equals(that.controllerState))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(controllerEvent_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
controllerEvent_args typedOther = (controllerEvent_args)other;
lastComparison = Boolean.valueOf(isSetPlayerId()).compareTo(typedOther.isSetPlayerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPlayerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.playerId, typedOther.playerId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetControllerState()).compareTo(typedOther.isSetControllerState());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetControllerState()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.controllerState, typedOther.controllerState);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("controllerEvent_args(");
boolean first = true;
sb.append("playerId:");
sb.append(this.playerId);
first = false;
if (!first) sb.append(", ");
sb.append("controllerState:");
if (this.controllerState == null) {
sb.append("null");
} else {
sb.append(this.controllerState);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class controllerEvent_argsStandardSchemeFactory implements SchemeFactory {
public controllerEvent_argsStandardScheme getScheme() {
return new controllerEvent_argsStandardScheme();
}
}
private static class controllerEvent_argsStandardScheme extends StandardScheme<controllerEvent_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, controllerEvent_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PLAYER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // CONTROLLER_STATE
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.controllerState = new ControllerState();
struct.controllerState.read(iprot);
struct.setControllerStateIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, controllerEvent_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(PLAYER_ID_FIELD_DESC);
oprot.writeI32(struct.playerId);
oprot.writeFieldEnd();
if (struct.controllerState != null) {
oprot.writeFieldBegin(CONTROLLER_STATE_FIELD_DESC);
struct.controllerState.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class controllerEvent_argsTupleSchemeFactory implements SchemeFactory {
public controllerEvent_argsTupleScheme getScheme() {
return new controllerEvent_argsTupleScheme();
}
}
private static class controllerEvent_argsTupleScheme extends TupleScheme<controllerEvent_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, controllerEvent_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPlayerId()) {
optionals.set(0);
}
if (struct.isSetControllerState()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPlayerId()) {
oprot.writeI32(struct.playerId);
}
if (struct.isSetControllerState()) {
struct.controllerState.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, controllerEvent_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
}
if (incoming.get(1)) {
struct.controllerState = new ControllerState();
struct.controllerState.read(iprot);
struct.setControllerStateIsSet(true);
}
}
}
}
public static class controllerEvent_result implements org.apache.thrift.TBase<controllerEvent_result, controllerEvent_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("controllerEvent_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField YOU_ARE_DEAD_FIELD_DESC = new org.apache.thrift.protocol.TField("youAreDead", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new controllerEvent_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new controllerEvent_resultTupleSchemeFactory());
}
public ControllerResult success; // required
public YouAreDeadException youAreDead; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
YOU_ARE_DEAD((short)1, "youAreDead"),
GAME_OVER((short)2, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // YOU_ARE_DEAD
return YOU_ARE_DEAD;
case 2: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ControllerResult.class)));
tmpMap.put(_Fields.YOU_ARE_DEAD, new org.apache.thrift.meta_data.FieldMetaData("youAreDead", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(controllerEvent_result.class, metaDataMap);
}
public controllerEvent_result() {
}
public controllerEvent_result(
ControllerResult success,
YouAreDeadException youAreDead,
GameOverException gameOver)
{
this();
this.success = success;
this.youAreDead = youAreDead;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public controllerEvent_result(controllerEvent_result other) {
if (other.isSetSuccess()) {
this.success = new ControllerResult(other.success);
}
if (other.isSetYouAreDead()) {
this.youAreDead = new YouAreDeadException(other.youAreDead);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public controllerEvent_result deepCopy() {
return new controllerEvent_result(this);
}
@Override
public void clear() {
this.success = null;
this.youAreDead = null;
this.gameOver = null;
}
public ControllerResult getSuccess() {
return this.success;
}
public controllerEvent_result setSuccess(ControllerResult success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public YouAreDeadException getYouAreDead() {
return this.youAreDead;
}
public controllerEvent_result setYouAreDead(YouAreDeadException youAreDead) {
this.youAreDead = youAreDead;
return this;
}
public void unsetYouAreDead() {
this.youAreDead = null;
}
/** Returns true if field youAreDead is set (has been assigned a value) and false otherwise */
public boolean isSetYouAreDead() {
return this.youAreDead != null;
}
public void setYouAreDeadIsSet(boolean value) {
if (!value) {
this.youAreDead = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public controllerEvent_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((ControllerResult)value);
}
break;
case YOU_ARE_DEAD:
if (value == null) {
unsetYouAreDead();
} else {
setYouAreDead((YouAreDeadException)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case YOU_ARE_DEAD:
return getYouAreDead();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case YOU_ARE_DEAD:
return isSetYouAreDead();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof controllerEvent_result)
return this.equals((controllerEvent_result)that);
return false;
}
public boolean equals(controllerEvent_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_youAreDead = true && this.isSetYouAreDead();
boolean that_present_youAreDead = true && that.isSetYouAreDead();
if (this_present_youAreDead || that_present_youAreDead) {
if (!(this_present_youAreDead && that_present_youAreDead))
return false;
if (!this.youAreDead.equals(that.youAreDead))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(controllerEvent_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
controllerEvent_result typedOther = (controllerEvent_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetYouAreDead()).compareTo(typedOther.isSetYouAreDead());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetYouAreDead()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.youAreDead, typedOther.youAreDead);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("controllerEvent_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("youAreDead:");
if (this.youAreDead == null) {
sb.append("null");
} else {
sb.append(this.youAreDead);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class controllerEvent_resultStandardSchemeFactory implements SchemeFactory {
public controllerEvent_resultStandardScheme getScheme() {
return new controllerEvent_resultStandardScheme();
}
}
private static class controllerEvent_resultStandardScheme extends StandardScheme<controllerEvent_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, controllerEvent_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new ControllerResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // YOU_ARE_DEAD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, controllerEvent_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.youAreDead != null) {
oprot.writeFieldBegin(YOU_ARE_DEAD_FIELD_DESC);
struct.youAreDead.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class controllerEvent_resultTupleSchemeFactory implements SchemeFactory {
public controllerEvent_resultTupleScheme getScheme() {
return new controllerEvent_resultTupleScheme();
}
}
private static class controllerEvent_resultTupleScheme extends TupleScheme<controllerEvent_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, controllerEvent_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetYouAreDead()) {
optionals.set(1);
}
if (struct.isSetGameOver()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetYouAreDead()) {
struct.youAreDead.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, controllerEvent_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new ControllerResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
}
if (incoming.get(2)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
public static class move_args implements org.apache.thrift.TBase<move_args, move_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("move_args");
private static final org.apache.thrift.protocol.TField PLAYER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("playerId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField MOVE_ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("moveAction", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new move_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new move_argsTupleSchemeFactory());
}
public int playerId; // required
public MoveAction moveAction; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PLAYER_ID((short)1, "playerId"),
MOVE_ACTION((short)2, "moveAction");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PLAYER_ID
return PLAYER_ID;
case 2: // MOVE_ACTION
return MOVE_ACTION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __PLAYERID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PLAYER_ID, new org.apache.thrift.meta_data.FieldMetaData("playerId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.MOVE_ACTION, new org.apache.thrift.meta_data.FieldMetaData("moveAction", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MoveAction.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(move_args.class, metaDataMap);
}
public move_args() {
}
public move_args(
int playerId,
MoveAction moveAction)
{
this();
this.playerId = playerId;
setPlayerIdIsSet(true);
this.moveAction = moveAction;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public move_args(move_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.playerId = other.playerId;
if (other.isSetMoveAction()) {
this.moveAction = new MoveAction(other.moveAction);
}
}
public move_args deepCopy() {
return new move_args(this);
}
@Override
public void clear() {
setPlayerIdIsSet(false);
this.playerId = 0;
this.moveAction = null;
}
public int getPlayerId() {
return this.playerId;
}
public move_args setPlayerId(int playerId) {
this.playerId = playerId;
setPlayerIdIsSet(true);
return this;
}
public void unsetPlayerId() {
__isset_bit_vector.clear(__PLAYERID_ISSET_ID);
}
/** Returns true if field playerId is set (has been assigned a value) and false otherwise */
public boolean isSetPlayerId() {
return __isset_bit_vector.get(__PLAYERID_ISSET_ID);
}
public void setPlayerIdIsSet(boolean value) {
__isset_bit_vector.set(__PLAYERID_ISSET_ID, value);
}
public MoveAction getMoveAction() {
return this.moveAction;
}
public move_args setMoveAction(MoveAction moveAction) {
this.moveAction = moveAction;
return this;
}
public void unsetMoveAction() {
this.moveAction = null;
}
/** Returns true if field moveAction is set (has been assigned a value) and false otherwise */
public boolean isSetMoveAction() {
return this.moveAction != null;
}
public void setMoveActionIsSet(boolean value) {
if (!value) {
this.moveAction = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PLAYER_ID:
if (value == null) {
unsetPlayerId();
} else {
setPlayerId((Integer)value);
}
break;
case MOVE_ACTION:
if (value == null) {
unsetMoveAction();
} else {
setMoveAction((MoveAction)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PLAYER_ID:
return Integer.valueOf(getPlayerId());
case MOVE_ACTION:
return getMoveAction();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PLAYER_ID:
return isSetPlayerId();
case MOVE_ACTION:
return isSetMoveAction();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof move_args)
return this.equals((move_args)that);
return false;
}
public boolean equals(move_args that) {
if (that == null)
return false;
boolean this_present_playerId = true;
boolean that_present_playerId = true;
if (this_present_playerId || that_present_playerId) {
if (!(this_present_playerId && that_present_playerId))
return false;
if (this.playerId != that.playerId)
return false;
}
boolean this_present_moveAction = true && this.isSetMoveAction();
boolean that_present_moveAction = true && that.isSetMoveAction();
if (this_present_moveAction || that_present_moveAction) {
if (!(this_present_moveAction && that_present_moveAction))
return false;
if (!this.moveAction.equals(that.moveAction))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(move_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
move_args typedOther = (move_args)other;
lastComparison = Boolean.valueOf(isSetPlayerId()).compareTo(typedOther.isSetPlayerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPlayerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.playerId, typedOther.playerId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetMoveAction()).compareTo(typedOther.isSetMoveAction());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetMoveAction()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.moveAction, typedOther.moveAction);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("move_args(");
boolean first = true;
sb.append("playerId:");
sb.append(this.playerId);
first = false;
if (!first) sb.append(", ");
sb.append("moveAction:");
if (this.moveAction == null) {
sb.append("null");
} else {
sb.append(this.moveAction);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class move_argsStandardSchemeFactory implements SchemeFactory {
public move_argsStandardScheme getScheme() {
return new move_argsStandardScheme();
}
}
private static class move_argsStandardScheme extends StandardScheme<move_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, move_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PLAYER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // MOVE_ACTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.moveAction = new MoveAction();
struct.moveAction.read(iprot);
struct.setMoveActionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, move_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(PLAYER_ID_FIELD_DESC);
oprot.writeI32(struct.playerId);
oprot.writeFieldEnd();
if (struct.moveAction != null) {
oprot.writeFieldBegin(MOVE_ACTION_FIELD_DESC);
struct.moveAction.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class move_argsTupleSchemeFactory implements SchemeFactory {
public move_argsTupleScheme getScheme() {
return new move_argsTupleScheme();
}
}
private static class move_argsTupleScheme extends TupleScheme<move_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, move_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPlayerId()) {
optionals.set(0);
}
if (struct.isSetMoveAction()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPlayerId()) {
oprot.writeI32(struct.playerId);
}
if (struct.isSetMoveAction()) {
struct.moveAction.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, move_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
}
if (incoming.get(1)) {
struct.moveAction = new MoveAction();
struct.moveAction.read(iprot);
struct.setMoveActionIsSet(true);
}
}
}
}
public static class move_result implements org.apache.thrift.TBase<move_result, move_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("move_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField YOU_ARE_DEAD_FIELD_DESC = new org.apache.thrift.protocol.TField("youAreDead", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new move_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new move_resultTupleSchemeFactory());
}
public MoveActionResult success; // required
public YouAreDeadException youAreDead; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
YOU_ARE_DEAD((short)1, "youAreDead"),
GAME_OVER((short)2, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // YOU_ARE_DEAD
return YOU_ARE_DEAD;
case 2: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MoveActionResult.class)));
tmpMap.put(_Fields.YOU_ARE_DEAD, new org.apache.thrift.meta_data.FieldMetaData("youAreDead", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(move_result.class, metaDataMap);
}
public move_result() {
}
public move_result(
MoveActionResult success,
YouAreDeadException youAreDead,
GameOverException gameOver)
{
this();
this.success = success;
this.youAreDead = youAreDead;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public move_result(move_result other) {
if (other.isSetSuccess()) {
this.success = new MoveActionResult(other.success);
}
if (other.isSetYouAreDead()) {
this.youAreDead = new YouAreDeadException(other.youAreDead);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public move_result deepCopy() {
return new move_result(this);
}
@Override
public void clear() {
this.success = null;
this.youAreDead = null;
this.gameOver = null;
}
public MoveActionResult getSuccess() {
return this.success;
}
public move_result setSuccess(MoveActionResult success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public YouAreDeadException getYouAreDead() {
return this.youAreDead;
}
public move_result setYouAreDead(YouAreDeadException youAreDead) {
this.youAreDead = youAreDead;
return this;
}
public void unsetYouAreDead() {
this.youAreDead = null;
}
/** Returns true if field youAreDead is set (has been assigned a value) and false otherwise */
public boolean isSetYouAreDead() {
return this.youAreDead != null;
}
public void setYouAreDeadIsSet(boolean value) {
if (!value) {
this.youAreDead = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public move_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((MoveActionResult)value);
}
break;
case YOU_ARE_DEAD:
if (value == null) {
unsetYouAreDead();
} else {
setYouAreDead((YouAreDeadException)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case YOU_ARE_DEAD:
return getYouAreDead();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case YOU_ARE_DEAD:
return isSetYouAreDead();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof move_result)
return this.equals((move_result)that);
return false;
}
public boolean equals(move_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_youAreDead = true && this.isSetYouAreDead();
boolean that_present_youAreDead = true && that.isSetYouAreDead();
if (this_present_youAreDead || that_present_youAreDead) {
if (!(this_present_youAreDead && that_present_youAreDead))
return false;
if (!this.youAreDead.equals(that.youAreDead))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(move_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
move_result typedOther = (move_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetYouAreDead()).compareTo(typedOther.isSetYouAreDead());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetYouAreDead()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.youAreDead, typedOther.youAreDead);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("move_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("youAreDead:");
if (this.youAreDead == null) {
sb.append("null");
} else {
sb.append(this.youAreDead);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class move_resultStandardSchemeFactory implements SchemeFactory {
public move_resultStandardScheme getScheme() {
return new move_resultStandardScheme();
}
}
private static class move_resultStandardScheme extends StandardScheme<move_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, move_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new MoveActionResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // YOU_ARE_DEAD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, move_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.youAreDead != null) {
oprot.writeFieldBegin(YOU_ARE_DEAD_FIELD_DESC);
struct.youAreDead.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class move_resultTupleSchemeFactory implements SchemeFactory {
public move_resultTupleScheme getScheme() {
return new move_resultTupleScheme();
}
}
private static class move_resultTupleScheme extends TupleScheme<move_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, move_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetYouAreDead()) {
optionals.set(1);
}
if (struct.isSetGameOver()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetYouAreDead()) {
struct.youAreDead.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, move_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new MoveActionResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
}
if (incoming.get(2)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
public static class bomb_args implements org.apache.thrift.TBase<bomb_args, bomb_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("bomb_args");
private static final org.apache.thrift.protocol.TField PLAYER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("playerId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField BOMB_ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("bombAction", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new bomb_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new bomb_argsTupleSchemeFactory());
}
public int playerId; // required
public BombAction bombAction; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
PLAYER_ID((short)1, "playerId"),
BOMB_ACTION((short)2, "bombAction");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PLAYER_ID
return PLAYER_ID;
case 2: // BOMB_ACTION
return BOMB_ACTION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __PLAYERID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PLAYER_ID, new org.apache.thrift.meta_data.FieldMetaData("playerId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.BOMB_ACTION, new org.apache.thrift.meta_data.FieldMetaData("bombAction", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BombAction.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(bomb_args.class, metaDataMap);
}
public bomb_args() {
}
public bomb_args(
int playerId,
BombAction bombAction)
{
this();
this.playerId = playerId;
setPlayerIdIsSet(true);
this.bombAction = bombAction;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public bomb_args(bomb_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.playerId = other.playerId;
if (other.isSetBombAction()) {
this.bombAction = new BombAction(other.bombAction);
}
}
public bomb_args deepCopy() {
return new bomb_args(this);
}
@Override
public void clear() {
setPlayerIdIsSet(false);
this.playerId = 0;
this.bombAction = null;
}
public int getPlayerId() {
return this.playerId;
}
public bomb_args setPlayerId(int playerId) {
this.playerId = playerId;
setPlayerIdIsSet(true);
return this;
}
public void unsetPlayerId() {
__isset_bit_vector.clear(__PLAYERID_ISSET_ID);
}
/** Returns true if field playerId is set (has been assigned a value) and false otherwise */
public boolean isSetPlayerId() {
return __isset_bit_vector.get(__PLAYERID_ISSET_ID);
}
public void setPlayerIdIsSet(boolean value) {
__isset_bit_vector.set(__PLAYERID_ISSET_ID, value);
}
public BombAction getBombAction() {
return this.bombAction;
}
public bomb_args setBombAction(BombAction bombAction) {
this.bombAction = bombAction;
return this;
}
public void unsetBombAction() {
this.bombAction = null;
}
/** Returns true if field bombAction is set (has been assigned a value) and false otherwise */
public boolean isSetBombAction() {
return this.bombAction != null;
}
public void setBombActionIsSet(boolean value) {
if (!value) {
this.bombAction = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PLAYER_ID:
if (value == null) {
unsetPlayerId();
} else {
setPlayerId((Integer)value);
}
break;
case BOMB_ACTION:
if (value == null) {
unsetBombAction();
} else {
setBombAction((BombAction)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PLAYER_ID:
return Integer.valueOf(getPlayerId());
case BOMB_ACTION:
return getBombAction();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PLAYER_ID:
return isSetPlayerId();
case BOMB_ACTION:
return isSetBombAction();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof bomb_args)
return this.equals((bomb_args)that);
return false;
}
public boolean equals(bomb_args that) {
if (that == null)
return false;
boolean this_present_playerId = true;
boolean that_present_playerId = true;
if (this_present_playerId || that_present_playerId) {
if (!(this_present_playerId && that_present_playerId))
return false;
if (this.playerId != that.playerId)
return false;
}
boolean this_present_bombAction = true && this.isSetBombAction();
boolean that_present_bombAction = true && that.isSetBombAction();
if (this_present_bombAction || that_present_bombAction) {
if (!(this_present_bombAction && that_present_bombAction))
return false;
if (!this.bombAction.equals(that.bombAction))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(bomb_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
bomb_args typedOther = (bomb_args)other;
lastComparison = Boolean.valueOf(isSetPlayerId()).compareTo(typedOther.isSetPlayerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetPlayerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.playerId, typedOther.playerId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetBombAction()).compareTo(typedOther.isSetBombAction());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetBombAction()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bombAction, typedOther.bombAction);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("bomb_args(");
boolean first = true;
sb.append("playerId:");
sb.append(this.playerId);
first = false;
if (!first) sb.append(", ");
sb.append("bombAction:");
if (this.bombAction == null) {
sb.append("null");
} else {
sb.append(this.bombAction);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class bomb_argsStandardSchemeFactory implements SchemeFactory {
public bomb_argsStandardScheme getScheme() {
return new bomb_argsStandardScheme();
}
}
private static class bomb_argsStandardScheme extends StandardScheme<bomb_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, bomb_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // PLAYER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // BOMB_ACTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.bombAction = new BombAction();
struct.bombAction.read(iprot);
struct.setBombActionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, bomb_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(PLAYER_ID_FIELD_DESC);
oprot.writeI32(struct.playerId);
oprot.writeFieldEnd();
if (struct.bombAction != null) {
oprot.writeFieldBegin(BOMB_ACTION_FIELD_DESC);
struct.bombAction.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class bomb_argsTupleSchemeFactory implements SchemeFactory {
public bomb_argsTupleScheme getScheme() {
return new bomb_argsTupleScheme();
}
}
private static class bomb_argsTupleScheme extends TupleScheme<bomb_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, bomb_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetPlayerId()) {
optionals.set(0);
}
if (struct.isSetBombAction()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetPlayerId()) {
oprot.writeI32(struct.playerId);
}
if (struct.isSetBombAction()) {
struct.bombAction.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, bomb_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.playerId = iprot.readI32();
struct.setPlayerIdIsSet(true);
}
if (incoming.get(1)) {
struct.bombAction = new BombAction();
struct.bombAction.read(iprot);
struct.setBombActionIsSet(true);
}
}
}
}
public static class bomb_result implements org.apache.thrift.TBase<bomb_result, bomb_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("bomb_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField YOU_ARE_DEAD_FIELD_DESC = new org.apache.thrift.protocol.TField("youAreDead", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new bomb_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new bomb_resultTupleSchemeFactory());
}
public BombActionResult success; // required
public YouAreDeadException youAreDead; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
YOU_ARE_DEAD((short)1, "youAreDead"),
GAME_OVER((short)2, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // YOU_ARE_DEAD
return YOU_ARE_DEAD;
case 2: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BombActionResult.class)));
tmpMap.put(_Fields.YOU_ARE_DEAD, new org.apache.thrift.meta_data.FieldMetaData("youAreDead", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(bomb_result.class, metaDataMap);
}
public bomb_result() {
}
public bomb_result(
BombActionResult success,
YouAreDeadException youAreDead,
GameOverException gameOver)
{
this();
this.success = success;
this.youAreDead = youAreDead;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public bomb_result(bomb_result other) {
if (other.isSetSuccess()) {
this.success = new BombActionResult(other.success);
}
if (other.isSetYouAreDead()) {
this.youAreDead = new YouAreDeadException(other.youAreDead);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public bomb_result deepCopy() {
return new bomb_result(this);
}
@Override
public void clear() {
this.success = null;
this.youAreDead = null;
this.gameOver = null;
}
public BombActionResult getSuccess() {
return this.success;
}
public bomb_result setSuccess(BombActionResult success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public YouAreDeadException getYouAreDead() {
return this.youAreDead;
}
public bomb_result setYouAreDead(YouAreDeadException youAreDead) {
this.youAreDead = youAreDead;
return this;
}
public void unsetYouAreDead() {
this.youAreDead = null;
}
/** Returns true if field youAreDead is set (has been assigned a value) and false otherwise */
public boolean isSetYouAreDead() {
return this.youAreDead != null;
}
public void setYouAreDeadIsSet(boolean value) {
if (!value) {
this.youAreDead = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public bomb_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((BombActionResult)value);
}
break;
case YOU_ARE_DEAD:
if (value == null) {
unsetYouAreDead();
} else {
setYouAreDead((YouAreDeadException)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case YOU_ARE_DEAD:
return getYouAreDead();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case YOU_ARE_DEAD:
return isSetYouAreDead();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof bomb_result)
return this.equals((bomb_result)that);
return false;
}
public boolean equals(bomb_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_youAreDead = true && this.isSetYouAreDead();
boolean that_present_youAreDead = true && that.isSetYouAreDead();
if (this_present_youAreDead || that_present_youAreDead) {
if (!(this_present_youAreDead && that_present_youAreDead))
return false;
if (!this.youAreDead.equals(that.youAreDead))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(bomb_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
bomb_result typedOther = (bomb_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetYouAreDead()).compareTo(typedOther.isSetYouAreDead());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetYouAreDead()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.youAreDead, typedOther.youAreDead);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("bomb_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("youAreDead:");
if (this.youAreDead == null) {
sb.append("null");
} else {
sb.append(this.youAreDead);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class bomb_resultStandardSchemeFactory implements SchemeFactory {
public bomb_resultStandardScheme getScheme() {
return new bomb_resultStandardScheme();
}
}
private static class bomb_resultStandardScheme extends StandardScheme<bomb_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, bomb_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new BombActionResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // YOU_ARE_DEAD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, bomb_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.youAreDead != null) {
oprot.writeFieldBegin(YOU_ARE_DEAD_FIELD_DESC);
struct.youAreDead.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class bomb_resultTupleSchemeFactory implements SchemeFactory {
public bomb_resultTupleScheme getScheme() {
return new bomb_resultTupleScheme();
}
}
private static class bomb_resultTupleScheme extends TupleScheme<bomb_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, bomb_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetYouAreDead()) {
optionals.set(1);
}
if (struct.isSetGameOver()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetYouAreDead()) {
struct.youAreDead.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, bomb_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new BombActionResult();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
}
if (incoming.get(2)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
public static class waitTicks_args implements org.apache.thrift.TBase<waitTicks_args, waitTicks_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitTicks_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField TICKS_FIELD_DESC = new org.apache.thrift.protocol.TField("ticks", org.apache.thrift.protocol.TType.I32, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitTicks_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitTicks_argsTupleSchemeFactory());
}
public int gameId; // required
public int ticks; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId"),
TICKS((short)2, "ticks");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
case 2: // TICKS
return TICKS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private static final int __TICKS_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.TICKS, new org.apache.thrift.meta_data.FieldMetaData("ticks", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitTicks_args.class, metaDataMap);
}
public waitTicks_args() {
}
public waitTicks_args(
int gameId,
int ticks)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
this.ticks = ticks;
setTicksIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitTicks_args(waitTicks_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
this.ticks = other.ticks;
}
public waitTicks_args deepCopy() {
return new waitTicks_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
setTicksIsSet(false);
this.ticks = 0;
}
public int getGameId() {
return this.gameId;
}
public waitTicks_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public int getTicks() {
return this.ticks;
}
public waitTicks_args setTicks(int ticks) {
this.ticks = ticks;
setTicksIsSet(true);
return this;
}
public void unsetTicks() {
__isset_bit_vector.clear(__TICKS_ISSET_ID);
}
/** Returns true if field ticks is set (has been assigned a value) and false otherwise */
public boolean isSetTicks() {
return __isset_bit_vector.get(__TICKS_ISSET_ID);
}
public void setTicksIsSet(boolean value) {
__isset_bit_vector.set(__TICKS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
case TICKS:
if (value == null) {
unsetTicks();
} else {
setTicks((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
case TICKS:
return Integer.valueOf(getTicks());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
case TICKS:
return isSetTicks();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitTicks_args)
return this.equals((waitTicks_args)that);
return false;
}
public boolean equals(waitTicks_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
boolean this_present_ticks = true;
boolean that_present_ticks = true;
if (this_present_ticks || that_present_ticks) {
if (!(this_present_ticks && that_present_ticks))
return false;
if (this.ticks != that.ticks)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitTicks_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitTicks_args typedOther = (waitTicks_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTicks()).compareTo(typedOther.isSetTicks());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTicks()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ticks, typedOther.ticks);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitTicks_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
if (!first) sb.append(", ");
sb.append("ticks:");
sb.append(this.ticks);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitTicks_argsStandardSchemeFactory implements SchemeFactory {
public waitTicks_argsStandardScheme getScheme() {
return new waitTicks_argsStandardScheme();
}
}
private static class waitTicks_argsStandardScheme extends StandardScheme<waitTicks_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitTicks_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // TICKS
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.ticks = iprot.readI32();
struct.setTicksIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitTicks_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(TICKS_FIELD_DESC);
oprot.writeI32(struct.ticks);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitTicks_argsTupleSchemeFactory implements SchemeFactory {
public waitTicks_argsTupleScheme getScheme() {
return new waitTicks_argsTupleScheme();
}
}
private static class waitTicks_argsTupleScheme extends TupleScheme<waitTicks_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitTicks_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
if (struct.isSetTicks()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
if (struct.isSetTicks()) {
oprot.writeI32(struct.ticks);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitTicks_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
if (incoming.get(1)) {
struct.ticks = iprot.readI32();
struct.setTicksIsSet(true);
}
}
}
}
public static class waitTicks_result implements org.apache.thrift.TBase<waitTicks_result, waitTicks_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitTicks_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField YOU_ARE_DEAD_FIELD_DESC = new org.apache.thrift.protocol.TField("youAreDead", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitTicks_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitTicks_resultTupleSchemeFactory());
}
public MapState success; // required
public YouAreDeadException youAreDead; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
YOU_ARE_DEAD((short)1, "youAreDead"),
GAME_OVER((short)2, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // YOU_ARE_DEAD
return YOU_ARE_DEAD;
case 2: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MapState.class)));
tmpMap.put(_Fields.YOU_ARE_DEAD, new org.apache.thrift.meta_data.FieldMetaData("youAreDead", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitTicks_result.class, metaDataMap);
}
public waitTicks_result() {
}
public waitTicks_result(
MapState success,
YouAreDeadException youAreDead,
GameOverException gameOver)
{
this();
this.success = success;
this.youAreDead = youAreDead;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitTicks_result(waitTicks_result other) {
if (other.isSetSuccess()) {
this.success = new MapState(other.success);
}
if (other.isSetYouAreDead()) {
this.youAreDead = new YouAreDeadException(other.youAreDead);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public waitTicks_result deepCopy() {
return new waitTicks_result(this);
}
@Override
public void clear() {
this.success = null;
this.youAreDead = null;
this.gameOver = null;
}
public MapState getSuccess() {
return this.success;
}
public waitTicks_result setSuccess(MapState success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public YouAreDeadException getYouAreDead() {
return this.youAreDead;
}
public waitTicks_result setYouAreDead(YouAreDeadException youAreDead) {
this.youAreDead = youAreDead;
return this;
}
public void unsetYouAreDead() {
this.youAreDead = null;
}
/** Returns true if field youAreDead is set (has been assigned a value) and false otherwise */
public boolean isSetYouAreDead() {
return this.youAreDead != null;
}
public void setYouAreDeadIsSet(boolean value) {
if (!value) {
this.youAreDead = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public waitTicks_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((MapState)value);
}
break;
case YOU_ARE_DEAD:
if (value == null) {
unsetYouAreDead();
} else {
setYouAreDead((YouAreDeadException)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case YOU_ARE_DEAD:
return getYouAreDead();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case YOU_ARE_DEAD:
return isSetYouAreDead();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitTicks_result)
return this.equals((waitTicks_result)that);
return false;
}
public boolean equals(waitTicks_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_youAreDead = true && this.isSetYouAreDead();
boolean that_present_youAreDead = true && that.isSetYouAreDead();
if (this_present_youAreDead || that_present_youAreDead) {
if (!(this_present_youAreDead && that_present_youAreDead))
return false;
if (!this.youAreDead.equals(that.youAreDead))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitTicks_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitTicks_result typedOther = (waitTicks_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetYouAreDead()).compareTo(typedOther.isSetYouAreDead());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetYouAreDead()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.youAreDead, typedOther.youAreDead);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitTicks_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("youAreDead:");
if (this.youAreDead == null) {
sb.append("null");
} else {
sb.append(this.youAreDead);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitTicks_resultStandardSchemeFactory implements SchemeFactory {
public waitTicks_resultStandardScheme getScheme() {
return new waitTicks_resultStandardScheme();
}
}
private static class waitTicks_resultStandardScheme extends StandardScheme<waitTicks_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitTicks_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // YOU_ARE_DEAD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitTicks_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.youAreDead != null) {
oprot.writeFieldBegin(YOU_ARE_DEAD_FIELD_DESC);
struct.youAreDead.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitTicks_resultTupleSchemeFactory implements SchemeFactory {
public waitTicks_resultTupleScheme getScheme() {
return new waitTicks_resultTupleScheme();
}
}
private static class waitTicks_resultTupleScheme extends TupleScheme<waitTicks_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitTicks_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetYouAreDead()) {
optionals.set(1);
}
if (struct.isSetGameOver()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetYouAreDead()) {
struct.youAreDead.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitTicks_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
}
if (incoming.get(2)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
public static class waitForTick_args implements org.apache.thrift.TBase<waitForTick_args, waitForTick_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitForTick_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField TICK_FIELD_DESC = new org.apache.thrift.protocol.TField("tick", org.apache.thrift.protocol.TType.I32, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitForTick_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitForTick_argsTupleSchemeFactory());
}
public int gameId; // required
public int tick; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId"),
TICK((short)2, "tick");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
case 2: // TICK
return TICK;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private static final int __TICK_ISSET_ID = 1;
private BitSet __isset_bit_vector = new BitSet(2);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.TICK, new org.apache.thrift.meta_data.FieldMetaData("tick", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitForTick_args.class, metaDataMap);
}
public waitForTick_args() {
}
public waitForTick_args(
int gameId,
int tick)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
this.tick = tick;
setTickIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitForTick_args(waitForTick_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
this.tick = other.tick;
}
public waitForTick_args deepCopy() {
return new waitForTick_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
setTickIsSet(false);
this.tick = 0;
}
public int getGameId() {
return this.gameId;
}
public waitForTick_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public int getTick() {
return this.tick;
}
public waitForTick_args setTick(int tick) {
this.tick = tick;
setTickIsSet(true);
return this;
}
public void unsetTick() {
__isset_bit_vector.clear(__TICK_ISSET_ID);
}
/** Returns true if field tick is set (has been assigned a value) and false otherwise */
public boolean isSetTick() {
return __isset_bit_vector.get(__TICK_ISSET_ID);
}
public void setTickIsSet(boolean value) {
__isset_bit_vector.set(__TICK_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
case TICK:
if (value == null) {
unsetTick();
} else {
setTick((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
case TICK:
return Integer.valueOf(getTick());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
case TICK:
return isSetTick();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitForTick_args)
return this.equals((waitForTick_args)that);
return false;
}
public boolean equals(waitForTick_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
boolean this_present_tick = true;
boolean that_present_tick = true;
if (this_present_tick || that_present_tick) {
if (!(this_present_tick && that_present_tick))
return false;
if (this.tick != that.tick)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitForTick_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitForTick_args typedOther = (waitForTick_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetTick()).compareTo(typedOther.isSetTick());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTick()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tick, typedOther.tick);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitForTick_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
if (!first) sb.append(", ");
sb.append("tick:");
sb.append(this.tick);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitForTick_argsStandardSchemeFactory implements SchemeFactory {
public waitForTick_argsStandardScheme getScheme() {
return new waitForTick_argsStandardScheme();
}
}
private static class waitForTick_argsStandardScheme extends StandardScheme<waitForTick_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitForTick_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // TICK
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.tick = iprot.readI32();
struct.setTickIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitForTick_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldBegin(TICK_FIELD_DESC);
oprot.writeI32(struct.tick);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitForTick_argsTupleSchemeFactory implements SchemeFactory {
public waitForTick_argsTupleScheme getScheme() {
return new waitForTick_argsTupleScheme();
}
}
private static class waitForTick_argsTupleScheme extends TupleScheme<waitForTick_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitForTick_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
if (struct.isSetTick()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
if (struct.isSetTick()) {
oprot.writeI32(struct.tick);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitForTick_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
if (incoming.get(1)) {
struct.tick = iprot.readI32();
struct.setTickIsSet(true);
}
}
}
}
public static class waitForTick_result implements org.apache.thrift.TBase<waitForTick_result, waitForTick_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitForTick_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField YOU_ARE_DEAD_FIELD_DESC = new org.apache.thrift.protocol.TField("youAreDead", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitForTick_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitForTick_resultTupleSchemeFactory());
}
public MapState success; // required
public YouAreDeadException youAreDead; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
YOU_ARE_DEAD((short)1, "youAreDead"),
GAME_OVER((short)2, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // YOU_ARE_DEAD
return YOU_ARE_DEAD;
case 2: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MapState.class)));
tmpMap.put(_Fields.YOU_ARE_DEAD, new org.apache.thrift.meta_data.FieldMetaData("youAreDead", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitForTick_result.class, metaDataMap);
}
public waitForTick_result() {
}
public waitForTick_result(
MapState success,
YouAreDeadException youAreDead,
GameOverException gameOver)
{
this();
this.success = success;
this.youAreDead = youAreDead;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitForTick_result(waitForTick_result other) {
if (other.isSetSuccess()) {
this.success = new MapState(other.success);
}
if (other.isSetYouAreDead()) {
this.youAreDead = new YouAreDeadException(other.youAreDead);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public waitForTick_result deepCopy() {
return new waitForTick_result(this);
}
@Override
public void clear() {
this.success = null;
this.youAreDead = null;
this.gameOver = null;
}
public MapState getSuccess() {
return this.success;
}
public waitForTick_result setSuccess(MapState success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public YouAreDeadException getYouAreDead() {
return this.youAreDead;
}
public waitForTick_result setYouAreDead(YouAreDeadException youAreDead) {
this.youAreDead = youAreDead;
return this;
}
public void unsetYouAreDead() {
this.youAreDead = null;
}
/** Returns true if field youAreDead is set (has been assigned a value) and false otherwise */
public boolean isSetYouAreDead() {
return this.youAreDead != null;
}
public void setYouAreDeadIsSet(boolean value) {
if (!value) {
this.youAreDead = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public waitForTick_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((MapState)value);
}
break;
case YOU_ARE_DEAD:
if (value == null) {
unsetYouAreDead();
} else {
setYouAreDead((YouAreDeadException)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case YOU_ARE_DEAD:
return getYouAreDead();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case YOU_ARE_DEAD:
return isSetYouAreDead();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitForTick_result)
return this.equals((waitForTick_result)that);
return false;
}
public boolean equals(waitForTick_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_youAreDead = true && this.isSetYouAreDead();
boolean that_present_youAreDead = true && that.isSetYouAreDead();
if (this_present_youAreDead || that_present_youAreDead) {
if (!(this_present_youAreDead && that_present_youAreDead))
return false;
if (!this.youAreDead.equals(that.youAreDead))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitForTick_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitForTick_result typedOther = (waitForTick_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetYouAreDead()).compareTo(typedOther.isSetYouAreDead());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetYouAreDead()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.youAreDead, typedOther.youAreDead);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitForTick_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("youAreDead:");
if (this.youAreDead == null) {
sb.append("null");
} else {
sb.append(this.youAreDead);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitForTick_resultStandardSchemeFactory implements SchemeFactory {
public waitForTick_resultStandardScheme getScheme() {
return new waitForTick_resultStandardScheme();
}
}
private static class waitForTick_resultStandardScheme extends StandardScheme<waitForTick_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitForTick_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // YOU_ARE_DEAD
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitForTick_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.youAreDead != null) {
oprot.writeFieldBegin(YOU_ARE_DEAD_FIELD_DESC);
struct.youAreDead.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitForTick_resultTupleSchemeFactory implements SchemeFactory {
public waitForTick_resultTupleScheme getScheme() {
return new waitForTick_resultTupleScheme();
}
}
private static class waitForTick_resultTupleScheme extends TupleScheme<waitForTick_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitForTick_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetYouAreDead()) {
optionals.set(1);
}
if (struct.isSetGameOver()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetYouAreDead()) {
struct.youAreDead.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitForTick_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.youAreDead = new YouAreDeadException();
struct.youAreDead.read(iprot);
struct.setYouAreDeadIsSet(true);
}
if (incoming.get(2)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
public static class joinGame_args implements org.apache.thrift.TBase<joinGame_args, joinGame_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("joinGame_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField CLIENTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("clientname", org.apache.thrift.protocol.TType.STRING, (short)3);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new joinGame_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new joinGame_argsTupleSchemeFactory());
}
public int gameId; // required
public String username; // required
public String clientname; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId"),
USERNAME((short)2, "username"),
CLIENTNAME((short)3, "clientname");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
case 2: // USERNAME
return USERNAME;
case 3: // CLIENTNAME
return CLIENTNAME;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.CLIENTNAME, new org.apache.thrift.meta_data.FieldMetaData("clientname", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(joinGame_args.class, metaDataMap);
}
public joinGame_args() {
}
public joinGame_args(
int gameId,
String username,
String clientname)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
this.username = username;
this.clientname = clientname;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public joinGame_args(joinGame_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
if (other.isSetUsername()) {
this.username = other.username;
}
if (other.isSetClientname()) {
this.clientname = other.clientname;
}
}
public joinGame_args deepCopy() {
return new joinGame_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
this.username = null;
this.clientname = null;
}
public int getGameId() {
return this.gameId;
}
public joinGame_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public String getUsername() {
return this.username;
}
public joinGame_args setUsername(String username) {
this.username = username;
return this;
}
public void unsetUsername() {
this.username = null;
}
/** Returns true if field username is set (has been assigned a value) and false otherwise */
public boolean isSetUsername() {
return this.username != null;
}
public void setUsernameIsSet(boolean value) {
if (!value) {
this.username = null;
}
}
public String getClientname() {
return this.clientname;
}
public joinGame_args setClientname(String clientname) {
this.clientname = clientname;
return this;
}
public void unsetClientname() {
this.clientname = null;
}
/** Returns true if field clientname is set (has been assigned a value) and false otherwise */
public boolean isSetClientname() {
return this.clientname != null;
}
public void setClientnameIsSet(boolean value) {
if (!value) {
this.clientname = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
case USERNAME:
if (value == null) {
unsetUsername();
} else {
setUsername((String)value);
}
break;
case CLIENTNAME:
if (value == null) {
unsetClientname();
} else {
setClientname((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
case USERNAME:
return getUsername();
case CLIENTNAME:
return getClientname();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
case USERNAME:
return isSetUsername();
case CLIENTNAME:
return isSetClientname();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof joinGame_args)
return this.equals((joinGame_args)that);
return false;
}
public boolean equals(joinGame_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
boolean this_present_username = true && this.isSetUsername();
boolean that_present_username = true && that.isSetUsername();
if (this_present_username || that_present_username) {
if (!(this_present_username && that_present_username))
return false;
if (!this.username.equals(that.username))
return false;
}
boolean this_present_clientname = true && this.isSetClientname();
boolean that_present_clientname = true && that.isSetClientname();
if (this_present_clientname || that_present_clientname) {
if (!(this_present_clientname && that_present_clientname))
return false;
if (!this.clientname.equals(that.clientname))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(joinGame_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
joinGame_args typedOther = (joinGame_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUsername()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetClientname()).compareTo(typedOther.isSetClientname());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetClientname()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientname, typedOther.clientname);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("joinGame_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
if (!first) sb.append(", ");
sb.append("username:");
if (this.username == null) {
sb.append("null");
} else {
sb.append(this.username);
}
first = false;
if (!first) sb.append(", ");
sb.append("clientname:");
if (this.clientname == null) {
sb.append("null");
} else {
sb.append(this.clientname);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class joinGame_argsStandardSchemeFactory implements SchemeFactory {
public joinGame_argsStandardScheme getScheme() {
return new joinGame_argsStandardScheme();
}
}
private static class joinGame_argsStandardScheme extends StandardScheme<joinGame_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, joinGame_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // USERNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // CLIENTNAME
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.clientname = iprot.readString();
struct.setClientnameIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, joinGame_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
if (struct.username != null) {
oprot.writeFieldBegin(USERNAME_FIELD_DESC);
oprot.writeString(struct.username);
oprot.writeFieldEnd();
}
if (struct.clientname != null) {
oprot.writeFieldBegin(CLIENTNAME_FIELD_DESC);
oprot.writeString(struct.clientname);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class joinGame_argsTupleSchemeFactory implements SchemeFactory {
public joinGame_argsTupleScheme getScheme() {
return new joinGame_argsTupleScheme();
}
}
private static class joinGame_argsTupleScheme extends TupleScheme<joinGame_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, joinGame_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
if (struct.isSetUsername()) {
optionals.set(1);
}
if (struct.isSetClientname()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
if (struct.isSetUsername()) {
oprot.writeString(struct.username);
}
if (struct.isSetClientname()) {
oprot.writeString(struct.clientname);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, joinGame_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(3);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
if (incoming.get(1)) {
struct.username = iprot.readString();
struct.setUsernameIsSet(true);
}
if (incoming.get(2)) {
struct.clientname = iprot.readString();
struct.setClientnameIsSet(true);
}
}
}
}
public static class joinGame_result implements org.apache.thrift.TBase<joinGame_result, joinGame_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("joinGame_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField GAME_OVER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOverException", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new joinGame_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new joinGame_resultTupleSchemeFactory());
}
public GameInfo success; // required
public GameOverException gameOverException; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
GAME_OVER_EXCEPTION((short)1, "gameOverException");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // GAME_OVER_EXCEPTION
return GAME_OVER_EXCEPTION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GameInfo.class)));
tmpMap.put(_Fields.GAME_OVER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("gameOverException", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(joinGame_result.class, metaDataMap);
}
public joinGame_result() {
}
public joinGame_result(
GameInfo success,
GameOverException gameOverException)
{
this();
this.success = success;
this.gameOverException = gameOverException;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public joinGame_result(joinGame_result other) {
if (other.isSetSuccess()) {
this.success = new GameInfo(other.success);
}
if (other.isSetGameOverException()) {
this.gameOverException = new GameOverException(other.gameOverException);
}
}
public joinGame_result deepCopy() {
return new joinGame_result(this);
}
@Override
public void clear() {
this.success = null;
this.gameOverException = null;
}
public GameInfo getSuccess() {
return this.success;
}
public joinGame_result setSuccess(GameInfo success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public GameOverException getGameOverException() {
return this.gameOverException;
}
public joinGame_result setGameOverException(GameOverException gameOverException) {
this.gameOverException = gameOverException;
return this;
}
public void unsetGameOverException() {
this.gameOverException = null;
}
/** Returns true if field gameOverException is set (has been assigned a value) and false otherwise */
public boolean isSetGameOverException() {
return this.gameOverException != null;
}
public void setGameOverExceptionIsSet(boolean value) {
if (!value) {
this.gameOverException = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((GameInfo)value);
}
break;
case GAME_OVER_EXCEPTION:
if (value == null) {
unsetGameOverException();
} else {
setGameOverException((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case GAME_OVER_EXCEPTION:
return getGameOverException();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case GAME_OVER_EXCEPTION:
return isSetGameOverException();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof joinGame_result)
return this.equals((joinGame_result)that);
return false;
}
public boolean equals(joinGame_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_gameOverException = true && this.isSetGameOverException();
boolean that_present_gameOverException = true && that.isSetGameOverException();
if (this_present_gameOverException || that_present_gameOverException) {
if (!(this_present_gameOverException && that_present_gameOverException))
return false;
if (!this.gameOverException.equals(that.gameOverException))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(joinGame_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
joinGame_result typedOther = (joinGame_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOverException()).compareTo(typedOther.isSetGameOverException());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOverException()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOverException, typedOther.gameOverException);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("joinGame_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOverException:");
if (this.gameOverException == null) {
sb.append("null");
} else {
sb.append(this.gameOverException);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class joinGame_resultStandardSchemeFactory implements SchemeFactory {
public joinGame_resultStandardScheme getScheme() {
return new joinGame_resultStandardScheme();
}
}
private static class joinGame_resultStandardScheme extends StandardScheme<joinGame_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, joinGame_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new GameInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // GAME_OVER_EXCEPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, joinGame_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOverException != null) {
oprot.writeFieldBegin(GAME_OVER_EXCEPTION_FIELD_DESC);
struct.gameOverException.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class joinGame_resultTupleSchemeFactory implements SchemeFactory {
public joinGame_resultTupleScheme getScheme() {
return new joinGame_resultTupleScheme();
}
}
private static class joinGame_resultTupleScheme extends TupleScheme<joinGame_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, joinGame_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetGameOverException()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetGameOverException()) {
struct.gameOverException.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, joinGame_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new GameInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
}
}
}
}
public static class getGameInfo_args implements org.apache.thrift.TBase<getGameInfo_args, getGameInfo_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGameInfo_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getGameInfo_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new getGameInfo_argsTupleSchemeFactory());
}
public int gameId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGameInfo_args.class, metaDataMap);
}
public getGameInfo_args() {
}
public getGameInfo_args(
int gameId)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getGameInfo_args(getGameInfo_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
}
public getGameInfo_args deepCopy() {
return new getGameInfo_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
}
public int getGameId() {
return this.gameId;
}
public getGameInfo_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getGameInfo_args)
return this.equals((getGameInfo_args)that);
return false;
}
public boolean equals(getGameInfo_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getGameInfo_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getGameInfo_args typedOther = (getGameInfo_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getGameInfo_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getGameInfo_argsStandardSchemeFactory implements SchemeFactory {
public getGameInfo_argsStandardScheme getScheme() {
return new getGameInfo_argsStandardScheme();
}
}
private static class getGameInfo_argsStandardScheme extends StandardScheme<getGameInfo_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getGameInfo_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getGameInfo_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getGameInfo_argsTupleSchemeFactory implements SchemeFactory {
public getGameInfo_argsTupleScheme getScheme() {
return new getGameInfo_argsTupleScheme();
}
}
private static class getGameInfo_argsTupleScheme extends TupleScheme<getGameInfo_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getGameInfo_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getGameInfo_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
}
}
}
public static class getGameInfo_result implements org.apache.thrift.TBase<getGameInfo_result, getGameInfo_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getGameInfo_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField GAME_OVER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOverException", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getGameInfo_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new getGameInfo_resultTupleSchemeFactory());
}
public GameInfo success; // required
public GameOverException gameOverException; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
GAME_OVER_EXCEPTION((short)1, "gameOverException");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // GAME_OVER_EXCEPTION
return GAME_OVER_EXCEPTION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, GameInfo.class)));
tmpMap.put(_Fields.GAME_OVER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("gameOverException", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getGameInfo_result.class, metaDataMap);
}
public getGameInfo_result() {
}
public getGameInfo_result(
GameInfo success,
GameOverException gameOverException)
{
this();
this.success = success;
this.gameOverException = gameOverException;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getGameInfo_result(getGameInfo_result other) {
if (other.isSetSuccess()) {
this.success = new GameInfo(other.success);
}
if (other.isSetGameOverException()) {
this.gameOverException = new GameOverException(other.gameOverException);
}
}
public getGameInfo_result deepCopy() {
return new getGameInfo_result(this);
}
@Override
public void clear() {
this.success = null;
this.gameOverException = null;
}
public GameInfo getSuccess() {
return this.success;
}
public getGameInfo_result setSuccess(GameInfo success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public GameOverException getGameOverException() {
return this.gameOverException;
}
public getGameInfo_result setGameOverException(GameOverException gameOverException) {
this.gameOverException = gameOverException;
return this;
}
public void unsetGameOverException() {
this.gameOverException = null;
}
/** Returns true if field gameOverException is set (has been assigned a value) and false otherwise */
public boolean isSetGameOverException() {
return this.gameOverException != null;
}
public void setGameOverExceptionIsSet(boolean value) {
if (!value) {
this.gameOverException = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((GameInfo)value);
}
break;
case GAME_OVER_EXCEPTION:
if (value == null) {
unsetGameOverException();
} else {
setGameOverException((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case GAME_OVER_EXCEPTION:
return getGameOverException();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case GAME_OVER_EXCEPTION:
return isSetGameOverException();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getGameInfo_result)
return this.equals((getGameInfo_result)that);
return false;
}
public boolean equals(getGameInfo_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_gameOverException = true && this.isSetGameOverException();
boolean that_present_gameOverException = true && that.isSetGameOverException();
if (this_present_gameOverException || that_present_gameOverException) {
if (!(this_present_gameOverException && that_present_gameOverException))
return false;
if (!this.gameOverException.equals(that.gameOverException))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getGameInfo_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getGameInfo_result typedOther = (getGameInfo_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOverException()).compareTo(typedOther.isSetGameOverException());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOverException()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOverException, typedOther.gameOverException);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getGameInfo_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOverException:");
if (this.gameOverException == null) {
sb.append("null");
} else {
sb.append(this.gameOverException);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getGameInfo_resultStandardSchemeFactory implements SchemeFactory {
public getGameInfo_resultStandardScheme getScheme() {
return new getGameInfo_resultStandardScheme();
}
}
private static class getGameInfo_resultStandardScheme extends StandardScheme<getGameInfo_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getGameInfo_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new GameInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // GAME_OVER_EXCEPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getGameInfo_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOverException != null) {
oprot.writeFieldBegin(GAME_OVER_EXCEPTION_FIELD_DESC);
struct.gameOverException.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getGameInfo_resultTupleSchemeFactory implements SchemeFactory {
public getGameInfo_resultTupleScheme getScheme() {
return new getGameInfo_resultTupleScheme();
}
}
private static class getGameInfo_resultTupleScheme extends TupleScheme<getGameInfo_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getGameInfo_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetGameOverException()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetGameOverException()) {
struct.gameOverException.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getGameInfo_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new GameInfo();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
}
}
}
}
public static class debugResetGame_args implements org.apache.thrift.TBase<debugResetGame_args, debugResetGame_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("debugResetGame_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new debugResetGame_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new debugResetGame_argsTupleSchemeFactory());
}
public int gameId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(debugResetGame_args.class, metaDataMap);
}
public debugResetGame_args() {
}
public debugResetGame_args(
int gameId)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public debugResetGame_args(debugResetGame_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
}
public debugResetGame_args deepCopy() {
return new debugResetGame_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
}
public int getGameId() {
return this.gameId;
}
public debugResetGame_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof debugResetGame_args)
return this.equals((debugResetGame_args)that);
return false;
}
public boolean equals(debugResetGame_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(debugResetGame_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
debugResetGame_args typedOther = (debugResetGame_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("debugResetGame_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class debugResetGame_argsStandardSchemeFactory implements SchemeFactory {
public debugResetGame_argsStandardScheme getScheme() {
return new debugResetGame_argsStandardScheme();
}
}
private static class debugResetGame_argsStandardScheme extends StandardScheme<debugResetGame_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, debugResetGame_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, debugResetGame_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class debugResetGame_argsTupleSchemeFactory implements SchemeFactory {
public debugResetGame_argsTupleScheme getScheme() {
return new debugResetGame_argsTupleScheme();
}
}
private static class debugResetGame_argsTupleScheme extends TupleScheme<debugResetGame_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, debugResetGame_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, debugResetGame_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
}
}
}
public static class debugResetGame_result implements org.apache.thrift.TBase<debugResetGame_result, debugResetGame_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("debugResetGame_result");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new debugResetGame_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new debugResetGame_resultTupleSchemeFactory());
}
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(debugResetGame_result.class, metaDataMap);
}
public debugResetGame_result() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public debugResetGame_result(debugResetGame_result other) {
}
public debugResetGame_result deepCopy() {
return new debugResetGame_result(this);
}
@Override
public void clear() {
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof debugResetGame_result)
return this.equals((debugResetGame_result)that);
return false;
}
public boolean equals(debugResetGame_result that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(debugResetGame_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
debugResetGame_result typedOther = (debugResetGame_result)other;
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("debugResetGame_result(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class debugResetGame_resultStandardSchemeFactory implements SchemeFactory {
public debugResetGame_resultStandardScheme getScheme() {
return new debugResetGame_resultStandardScheme();
}
}
private static class debugResetGame_resultStandardScheme extends StandardScheme<debugResetGame_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, debugResetGame_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, debugResetGame_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class debugResetGame_resultTupleSchemeFactory implements SchemeFactory {
public debugResetGame_resultTupleScheme getScheme() {
return new debugResetGame_resultTupleScheme();
}
}
private static class debugResetGame_resultTupleScheme extends TupleScheme<debugResetGame_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, debugResetGame_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, debugResetGame_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
public static class waitForStart_args implements org.apache.thrift.TBase<waitForStart_args, waitForStart_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitForStart_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitForStart_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitForStart_argsTupleSchemeFactory());
}
public int gameId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitForStart_args.class, metaDataMap);
}
public waitForStart_args() {
}
public waitForStart_args(
int gameId)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitForStart_args(waitForStart_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
}
public waitForStart_args deepCopy() {
return new waitForStart_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
}
public int getGameId() {
return this.gameId;
}
public waitForStart_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitForStart_args)
return this.equals((waitForStart_args)that);
return false;
}
public boolean equals(waitForStart_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitForStart_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitForStart_args typedOther = (waitForStart_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitForStart_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitForStart_argsStandardSchemeFactory implements SchemeFactory {
public waitForStart_argsStandardScheme getScheme() {
return new waitForStart_argsStandardScheme();
}
}
private static class waitForStart_argsStandardScheme extends StandardScheme<waitForStart_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitForStart_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitForStart_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitForStart_argsTupleSchemeFactory implements SchemeFactory {
public waitForStart_argsTupleScheme getScheme() {
return new waitForStart_argsTupleScheme();
}
}
private static class waitForStart_argsTupleScheme extends TupleScheme<waitForStart_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitForStart_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitForStart_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
}
}
}
public static class waitForStart_result implements org.apache.thrift.TBase<waitForStart_result, waitForStart_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("waitForStart_result");
private static final org.apache.thrift.protocol.TField GAME_OVER_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOverException", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new waitForStart_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new waitForStart_resultTupleSchemeFactory());
}
public GameOverException gameOverException; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_OVER_EXCEPTION((short)1, "gameOverException");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_OVER_EXCEPTION
return GAME_OVER_EXCEPTION;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_OVER_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("gameOverException", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(waitForStart_result.class, metaDataMap);
}
public waitForStart_result() {
}
public waitForStart_result(
GameOverException gameOverException)
{
this();
this.gameOverException = gameOverException;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public waitForStart_result(waitForStart_result other) {
if (other.isSetGameOverException()) {
this.gameOverException = new GameOverException(other.gameOverException);
}
}
public waitForStart_result deepCopy() {
return new waitForStart_result(this);
}
@Override
public void clear() {
this.gameOverException = null;
}
public GameOverException getGameOverException() {
return this.gameOverException;
}
public waitForStart_result setGameOverException(GameOverException gameOverException) {
this.gameOverException = gameOverException;
return this;
}
public void unsetGameOverException() {
this.gameOverException = null;
}
/** Returns true if field gameOverException is set (has been assigned a value) and false otherwise */
public boolean isSetGameOverException() {
return this.gameOverException != null;
}
public void setGameOverExceptionIsSet(boolean value) {
if (!value) {
this.gameOverException = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_OVER_EXCEPTION:
if (value == null) {
unsetGameOverException();
} else {
setGameOverException((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_OVER_EXCEPTION:
return getGameOverException();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_OVER_EXCEPTION:
return isSetGameOverException();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof waitForStart_result)
return this.equals((waitForStart_result)that);
return false;
}
public boolean equals(waitForStart_result that) {
if (that == null)
return false;
boolean this_present_gameOverException = true && this.isSetGameOverException();
boolean that_present_gameOverException = true && that.isSetGameOverException();
if (this_present_gameOverException || that_present_gameOverException) {
if (!(this_present_gameOverException && that_present_gameOverException))
return false;
if (!this.gameOverException.equals(that.gameOverException))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(waitForStart_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
waitForStart_result typedOther = (waitForStart_result)other;
lastComparison = Boolean.valueOf(isSetGameOverException()).compareTo(typedOther.isSetGameOverException());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOverException()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOverException, typedOther.gameOverException);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("waitForStart_result(");
boolean first = true;
sb.append("gameOverException:");
if (this.gameOverException == null) {
sb.append("null");
} else {
sb.append(this.gameOverException);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class waitForStart_resultStandardSchemeFactory implements SchemeFactory {
public waitForStart_resultStandardScheme getScheme() {
return new waitForStart_resultStandardScheme();
}
}
private static class waitForStart_resultStandardScheme extends StandardScheme<waitForStart_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, waitForStart_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_OVER_EXCEPTION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, waitForStart_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.gameOverException != null) {
oprot.writeFieldBegin(GAME_OVER_EXCEPTION_FIELD_DESC);
struct.gameOverException.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class waitForStart_resultTupleSchemeFactory implements SchemeFactory {
public waitForStart_resultTupleScheme getScheme() {
return new waitForStart_resultTupleScheme();
}
}
private static class waitForStart_resultTupleScheme extends TupleScheme<waitForStart_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, waitForStart_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameOverException()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetGameOverException()) {
struct.gameOverException.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, waitForStart_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.gameOverException = new GameOverException();
struct.gameOverException.read(iprot);
struct.setGameOverExceptionIsSet(true);
}
}
}
}
public static class getMapState_args implements org.apache.thrift.TBase<getMapState_args, getMapState_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMapState_args");
private static final org.apache.thrift.protocol.TField GAME_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gameId", org.apache.thrift.protocol.TType.I32, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getMapState_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new getMapState_argsTupleSchemeFactory());
}
public int gameId; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
GAME_ID((short)1, "gameId");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // GAME_ID
return GAME_ID;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __GAMEID_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.GAME_ID, new org.apache.thrift.meta_data.FieldMetaData("gameId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMapState_args.class, metaDataMap);
}
public getMapState_args() {
}
public getMapState_args(
int gameId)
{
this();
this.gameId = gameId;
setGameIdIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getMapState_args(getMapState_args other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
this.gameId = other.gameId;
}
public getMapState_args deepCopy() {
return new getMapState_args(this);
}
@Override
public void clear() {
setGameIdIsSet(false);
this.gameId = 0;
}
public int getGameId() {
return this.gameId;
}
public getMapState_args setGameId(int gameId) {
this.gameId = gameId;
setGameIdIsSet(true);
return this;
}
public void unsetGameId() {
__isset_bit_vector.clear(__GAMEID_ISSET_ID);
}
/** Returns true if field gameId is set (has been assigned a value) and false otherwise */
public boolean isSetGameId() {
return __isset_bit_vector.get(__GAMEID_ISSET_ID);
}
public void setGameIdIsSet(boolean value) {
__isset_bit_vector.set(__GAMEID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case GAME_ID:
if (value == null) {
unsetGameId();
} else {
setGameId((Integer)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case GAME_ID:
return Integer.valueOf(getGameId());
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case GAME_ID:
return isSetGameId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getMapState_args)
return this.equals((getMapState_args)that);
return false;
}
public boolean equals(getMapState_args that) {
if (that == null)
return false;
boolean this_present_gameId = true;
boolean that_present_gameId = true;
if (this_present_gameId || that_present_gameId) {
if (!(this_present_gameId && that_present_gameId))
return false;
if (this.gameId != that.gameId)
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getMapState_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getMapState_args typedOther = (getMapState_args)other;
lastComparison = Boolean.valueOf(isSetGameId()).compareTo(typedOther.isSetGameId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameId, typedOther.gameId);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getMapState_args(");
boolean first = true;
sb.append("gameId:");
sb.append(this.gameId);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bit_vector = new BitSet(1);
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getMapState_argsStandardSchemeFactory implements SchemeFactory {
public getMapState_argsStandardScheme getScheme() {
return new getMapState_argsStandardScheme();
}
}
private static class getMapState_argsStandardScheme extends StandardScheme<getMapState_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getMapState_args struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // GAME_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getMapState_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(GAME_ID_FIELD_DESC);
oprot.writeI32(struct.gameId);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getMapState_argsTupleSchemeFactory implements SchemeFactory {
public getMapState_argsTupleScheme getScheme() {
return new getMapState_argsTupleScheme();
}
}
private static class getMapState_argsTupleScheme extends TupleScheme<getMapState_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getMapState_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetGameId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetGameId()) {
oprot.writeI32(struct.gameId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getMapState_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.gameId = iprot.readI32();
struct.setGameIdIsSet(true);
}
}
}
}
public static class getMapState_result implements org.apache.thrift.TBase<getMapState_result, getMapState_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMapState_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
private static final org.apache.thrift.protocol.TField GAME_OVER_FIELD_DESC = new org.apache.thrift.protocol.TField("gameOver", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new getMapState_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new getMapState_resultTupleSchemeFactory());
}
public MapState success; // required
public GameOverException gameOver; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
SUCCESS((short)0, "success"),
GAME_OVER((short)1, "gameOver");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 0: // SUCCESS
return SUCCESS;
case 1: // GAME_OVER
return GAME_OVER;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MapState.class)));
tmpMap.put(_Fields.GAME_OVER, new org.apache.thrift.meta_data.FieldMetaData("gameOver", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMapState_result.class, metaDataMap);
}
public getMapState_result() {
}
public getMapState_result(
MapState success,
GameOverException gameOver)
{
this();
this.success = success;
this.gameOver = gameOver;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public getMapState_result(getMapState_result other) {
if (other.isSetSuccess()) {
this.success = new MapState(other.success);
}
if (other.isSetGameOver()) {
this.gameOver = new GameOverException(other.gameOver);
}
}
public getMapState_result deepCopy() {
return new getMapState_result(this);
}
@Override
public void clear() {
this.success = null;
this.gameOver = null;
}
public MapState getSuccess() {
return this.success;
}
public getMapState_result setSuccess(MapState success) {
this.success = success;
return this;
}
public void unsetSuccess() {
this.success = null;
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return this.success != null;
}
public void setSuccessIsSet(boolean value) {
if (!value) {
this.success = null;
}
}
public GameOverException getGameOver() {
return this.gameOver;
}
public getMapState_result setGameOver(GameOverException gameOver) {
this.gameOver = gameOver;
return this;
}
public void unsetGameOver() {
this.gameOver = null;
}
/** Returns true if field gameOver is set (has been assigned a value) and false otherwise */
public boolean isSetGameOver() {
return this.gameOver != null;
}
public void setGameOverIsSet(boolean value) {
if (!value) {
this.gameOver = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((MapState)value);
}
break;
case GAME_OVER:
if (value == null) {
unsetGameOver();
} else {
setGameOver((GameOverException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SUCCESS:
return getSuccess();
case GAME_OVER:
return getGameOver();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case SUCCESS:
return isSetSuccess();
case GAME_OVER:
return isSetGameOver();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof getMapState_result)
return this.equals((getMapState_result)that);
return false;
}
public boolean equals(getMapState_result that) {
if (that == null)
return false;
boolean this_present_success = true && this.isSetSuccess();
boolean that_present_success = true && that.isSetSuccess();
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (!this.success.equals(that.success))
return false;
}
boolean this_present_gameOver = true && this.isSetGameOver();
boolean that_present_gameOver = true && that.isSetGameOver();
if (this_present_gameOver || that_present_gameOver) {
if (!(this_present_gameOver && that_present_gameOver))
return false;
if (!this.gameOver.equals(that.gameOver))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(getMapState_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
getMapState_result typedOther = (getMapState_result)other;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetGameOver()).compareTo(typedOther.isSetGameOver());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetGameOver()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gameOver, typedOther.gameOver);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("getMapState_result(");
boolean first = true;
sb.append("success:");
if (this.success == null) {
sb.append("null");
} else {
sb.append(this.success);
}
first = false;
if (!first) sb.append(", ");
sb.append("gameOver:");
if (this.gameOver == null) {
sb.append("null");
} else {
sb.append(this.gameOver);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
try {
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class getMapState_resultStandardSchemeFactory implements SchemeFactory {
public getMapState_resultStandardScheme getScheme() {
return new getMapState_resultStandardScheme();
}
}
private static class getMapState_resultStandardScheme extends StandardScheme<getMapState_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, getMapState_result struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 1: // GAME_OVER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, getMapState_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
struct.success.write(oprot);
oprot.writeFieldEnd();
}
if (struct.gameOver != null) {
oprot.writeFieldBegin(GAME_OVER_FIELD_DESC);
struct.gameOver.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class getMapState_resultTupleSchemeFactory implements SchemeFactory {
public getMapState_resultTupleScheme getScheme() {
return new getMapState_resultTupleScheme();
}
}
private static class getMapState_resultTupleScheme extends TupleScheme<getMapState_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, getMapState_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetSuccess()) {
optionals.set(0);
}
if (struct.isSetGameOver()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetSuccess()) {
struct.success.write(oprot);
}
if (struct.isSetGameOver()) {
struct.gameOver.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, getMapState_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.success = new MapState();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
if (incoming.get(1)) {
struct.gameOver = new GameOverException();
struct.gameOver.read(iprot);
struct.setGameOverIsSet(true);
}
}
}
}
}