thrift 基本介绍
thrift 用于服务器之间RPC通信,可以跨语言。它是典型的C/S模式,需要中间语言协助实现通信(IDL).
thrif 数据类型
基本数据类型
byte
i16
i32
i64
double:64
string
容器类型
list
set
map 键值对形式
结构体类型 struct ,可以理解成Java中的bean,看下面的一个struct示例
struct User{
1:i64 id;
2:string name;
3:list<string> emails;
}
枚举类型 enum ,和Java中的 enum 类似
enum sex{
1, //1表示男 2表示女
2
}
异常 exception ,thrift支持自定义异常
exception myException{
1:i64 code;
2:string message;
}
服务 service 对应Java中的interface,使用thrift 生产Java 文件是 class 文件,class中有个内部接口 ,实现这个服务时候需要实现这个class中的 iface接口
service IUserDao{
i:32 addUserBean(1:UserBean user);
i:32 delUserBean(1:i64 userID);
UserBean findUserBean(1:i64 userID);
list<UserBean> findUserBean(1:string name,2:i64 userID);
UserBean alterUserBean(1:UserBean user);
}
自定义类型 typedef
typedef i32 int
typedef i64 long
常量 const
const i64 ENTER =100;
const string dns=“www.vrv.com”;
包 package 也叫namespace
namespace java com.vrv.ent
namespace java com.jerfan.bz
引入 include 类似Java 中的 import 和c 中的include
include “com.vrv.ent“
注释 shell 风格
单行 # 或者//
块 /**/
修饰符 required 表示必须的 optional 表示可选的
struct UserBean {
1: required string name;
2: optional i32 age;
}
thrift生产Java代码
thrift 生成代码 ,本人是Java 语言 只介绍 生成Java 语言
新建一个后缀为thrift的文件 dao.thrif,起内容是
namespace cpp com.vrv.im.dao
namespace java com.vrv.im.dao
struct EntUserBean {
1:i64 EntUserID;
2:string login;
3:string loginType;
4:string extend;
5:string userid;
}
struct UserBean {
1:i64 id;
2:string name;
3:string nickName;
4:string extend;
}
service IUserDao{
list<UserBean> queryAllEntUser();
i32 addUserBean(1:UserBean user);
UserBean updateUserBean(1:UserBean user);
UserBean queryUserBean(1:i64 userID);
UserBean deleteUserBean(1:i64 userID);
}
service IEntUserDao{
list<EntUserBean> queryAllEntUser();
i32 addEntUser(1:EntUserBean user);
EntUserBean updateEntUserBean(1:EntUserBean user);
EntUserBean queryEntUserBean(1:i64 userID);
EntUserBean deleteEntUserBean(1:i64 userID);
}
下载个thrift_x_x_x.exe 文件 ,dos模式进入到 该位置 建议把exe 和 thrift 文件放在同一目录下,执行 thrift -gen java dao.thrif
然后会生成一个gen-java目录,其中生成的Java代码在里面 
UserBean.java的内容`/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.vrv.im.dao;
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 org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({“cast”, “rawtypes”, “serial”, “unchecked”})
@Generated(value = “Autogenerated by Thrift Compiler (0.9.3)”, date = “2016-09-23”)
public class UserBean implements org.apache.thrift.TBase
/**
* Autogenerated by Thrift Compiler (0.9.3)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package com.vrv.im.dao;
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 org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-09-23")
public class IEntUserDao {
public interface Iface {
public List<EntUserBean> queryAllEntUser() throws org.apache.thrift.TException;
public int addEntUser(EntUserBean user) throws org.apache.thrift.TException;
public EntUserBean updateEntUserBean(EntUserBean user) throws org.apache.thrift.TException;
public EntUserBean queryEntUserBean(long userID) throws org.apache.thrift.TException;
public EntUserBean deleteEntUserBean(long userID) throws org.apache.thrift.TException;
}
public interface AsyncIface {
public void queryAllEntUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void addEntUser(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void updateEntUserBean(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void queryEntUserBean(long userID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void deleteEntUserBean(long userID, org.apache.thrift.async.AsyncMethodCallback 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 List<EntUserBean> queryAllEntUser() throws org.apache.thrift.TException
{
send_queryAllEntUser();
return recv_queryAllEntUser();
}
public void send_queryAllEntUser() throws org.apache.thrift.TException
{
queryAllEntUser_args args = new queryAllEntUser_args();
sendBase("queryAllEntUser", args);
}
public List<EntUserBean> recv_queryAllEntUser() throws org.apache.thrift.TException
{
queryAllEntUser_result result = new queryAllEntUser_result();
receiveBase(result, "queryAllEntUser");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryAllEntUser failed: unknown result");
}
public int addEntUser(EntUserBean user) throws org.apache.thrift.TException
{
send_addEntUser(user);
return recv_addEntUser();
}
public void send_addEntUser(EntUserBean user) throws org.apache.thrift.TException
{
addEntUser_args args = new addEntUser_args();
args.setUser(user);
sendBase("addEntUser", args);
}
public int recv_addEntUser() throws org.apache.thrift.TException
{
addEntUser_result result = new addEntUser_result();
receiveBase(result, "addEntUser");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "addEntUser failed: unknown result");
}
public EntUserBean updateEntUserBean(EntUserBean user) throws org.apache.thrift.TException
{
send_updateEntUserBean(user);
return recv_updateEntUserBean();
}
public void send_updateEntUserBean(EntUserBean user) throws org.apache.thrift.TException
{
updateEntUserBean_args args = new updateEntUserBean_args();
args.setUser(user);
sendBase("updateEntUserBean", args);
}
public EntUserBean recv_updateEntUserBean() throws org.apache.thrift.TException
{
updateEntUserBean_result result = new updateEntUserBean_result();
receiveBase(result, "updateEntUserBean");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateEntUserBean failed: unknown result");
}
public EntUserBean queryEntUserBean(long userID) throws org.apache.thrift.TException
{
send_queryEntUserBean(userID);
return recv_queryEntUserBean();
}
public void send_queryEntUserBean(long userID) throws org.apache.thrift.TException
{
queryEntUserBean_args args = new queryEntUserBean_args();
args.setUserID(userID);
sendBase("queryEntUserBean", args);
}
public EntUserBean recv_queryEntUserBean() throws org.apache.thrift.TException
{
queryEntUserBean_result result = new queryEntUserBean_result();
receiveBase(result, "queryEntUserBean");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "queryEntUserBean failed: unknown result");
}
public EntUserBean deleteEntUserBean(long userID) throws org.apache.thrift.TException
{
send_deleteEntUserBean(userID);
return recv_deleteEntUserBean();
}
public void send_deleteEntUserBean(long userID) throws org.apache.thrift.TException
{
deleteEntUserBean_args args = new deleteEntUserBean_args();
args.setUserID(userID);
sendBase("deleteEntUserBean", args);
}
public EntUserBean recv_deleteEntUserBean() throws org.apache.thrift.TException
{
deleteEntUserBean_result result = new deleteEntUserBean_result();
receiveBase(result, "deleteEntUserBean");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteEntUserBean 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 queryAllEntUser(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
queryAllEntUser_call method_call = new queryAllEntUser_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class queryAllEntUser_call extends org.apache.thrift.async.TAsyncMethodCall {
public queryAllEntUser_call(org.apache.thrift.async.AsyncMethodCallback 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("queryAllEntUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
queryAllEntUser_args args = new queryAllEntUser_args();
args.write(prot);
prot.writeMessageEnd();
}
public List<EntUserBean> 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_queryAllEntUser();
}
}
public void addEntUser(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
addEntUser_call method_call = new addEntUser_call(user, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class addEntUser_call extends org.apache.thrift.async.TAsyncMethodCall {
private EntUserBean user;
public addEntUser_call(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback 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.user = user;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("addEntUser", org.apache.thrift.protocol.TMessageType.CALL, 0));
addEntUser_args args = new addEntUser_args();
args.setUser(user);
args.write(prot);
prot.writeMessageEnd();
}
public int 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_addEntUser();
}
}
public void updateEntUserBean(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
updateEntUserBean_call method_call = new updateEntUserBean_call(user, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class updateEntUserBean_call extends org.apache.thrift.async.TAsyncMethodCall {
private EntUserBean user;
public updateEntUserBean_call(EntUserBean user, org.apache.thrift.async.AsyncMethodCallback 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.user = user;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateEntUserBean", org.apache.thrift.protocol.TMessageType.CALL, 0));
updateEntUserBean_args args = new updateEntUserBean_args();
args.setUser(user);
args.write(prot);
prot.writeMessageEnd();
}
public EntUserBean 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_updateEntUserBean();
}
}
public void queryEntUserBean(long userID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
queryEntUserBean_call method_call = new queryEntUserBean_call(userID, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class queryEntUserBean_call extends org.apache.thrift.async.TAsyncMethodCall {
private long userID;
public queryEntUserBean_call(long userID, org.apache.thrift.async.AsyncMethodCallback 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.userID = userID;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("queryEntUserBean", org.apache.thrift.protocol.TMessageType.CALL, 0));
queryEntUserBean_args args = new queryEntUserBean_args();
args.setUserID(userID);
args.write(prot);
prot.writeMessageEnd();
}
public EntUserBean 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_queryEntUserBean();
}
}
public void deleteEntUserBean(long userID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
deleteEntUserBean_call method_call = new deleteEntUserBean_call(userID, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class deleteEntUserBean_call extends org.apache.thrift.async.TAsyncMethodCall {
private long userID;
public deleteEntUserBean_call(long userID, org.apache.thrift.async.AsyncMethodCallback 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.userID = userID;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteEntUserBean", org.apache.thrift.protocol.TMessageType.CALL, 0));
deleteEntUserBean_args args = new deleteEntUserBean_args();
args.setUserID(userID);
args.write(prot);
prot.writeMessageEnd();
}
public EntUserBean 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_deleteEntUserBean();
}
}
}
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("queryAllEntUser", new queryAllEntUser());
processMap.put("addEntUser", new addEntUser());
processMap.put("updateEntUserBean", new updateEntUserBean());
processMap.put("queryEntUserBean", new queryEntUserBean());
processMap.put("deleteEntUserBean", new deleteEntUserBean());
return processMap;
}
public static class queryAllEntUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, queryAllEntUser_args> {
public queryAllEntUser() {
super("queryAllEntUser");
}
public queryAllEntUser_args getEmptyArgsInstance() {
return new queryAllEntUser_args();
}
protected boolean isOneway() {
return false;
}
public queryAllEntUser_result getResult(I iface, queryAllEntUser_args args) throws org.apache.thrift.TException {
queryAllEntUser_result result = new queryAllEntUser_result();
result.success = iface.queryAllEntUser();
return result;
}
}
public static class addEntUser<I extends Iface> extends org.apache.thrift.ProcessFunction<I, addEntUser_args> {
public addEntUser() {
super("addEntUser");
}
public addEntUser_args getEmptyArgsInstance() {
return new addEntUser_args();
}
protected boolean isOneway() {
return false;
}
public addEntUser_result getResult(I iface, addEntUser_args args) throws org.apache.thrift.TException {
addEntUser_result result = new addEntUser_result();
result.success = iface.addEntUser(args.user);
result.setSuccessIsSet(true);
return result;
}
}
public static class updateEntUserBean<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateEntUserBean_args> {
public updateEntUserBean() {
super("updateEntUserBean");
}
public updateEntUserBean_args getEmptyArgsInstance() {
return new updateEntUserBean_args();
}
protected boolean isOneway() {
return false;
}
public updateEntUserBean_result getResult(I iface, updateEntUserBean_args args) throws org.apache.thrift.TException {
updateEntUserBean_result result = new updateEntUserBean_result();
result.success = iface.updateEntUserBean(args.user);
return result;
}
}
public static class queryEntUserBean<I extends Iface> extends org.apache.thrift.ProcessFunction<I, queryEntUserBean_args> {
public queryEntUserBean() {
super("queryEntUserBean");
}
public queryEntUserBean_args getEmptyArgsInstance() {
return new queryEntUserBean_args();
}
protected boolean isOneway() {
return false;
}
public queryEntUserBean_result getResult(I iface, queryEntUserBean_args args) throws org.apache.thrift.TException {
queryEntUserBean_result result = new queryEntUserBean_result();
result.success = iface.queryEntUserBean(args.userID);
return result;
}
}
public static class deleteEntUserBean<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteEntUserBean_args> {
public deleteEntUserBean() {
super("deleteEntUserBean");
}
public deleteEntUserBean_args getEmptyArgsInstance() {
return new deleteEntUserBean_args();
}
protected boolean isOneway() {
return false;
}
public deleteEntUserBean_result getResult(I iface, deleteEntUserBean_args args) throws org.apache.thrift.TException {
deleteEntUserBean_result result = new deleteEntUserBean_result();
result.success = iface.deleteEntUserBean(args.userID);
return result;
}
}
}
public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
}
protected AsyncProcessor(I iface, Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
super(iface, getProcessMap(processMap));
}
private static <I extends AsyncIface> Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase,?>> getProcessMap(Map<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>> processMap) {
processMap.put("queryAllEntUser", new queryAllEntUser());
processMap.put("addEntUser", new addEntUser());
processMap.put("updateEntUserBean", new updateEntUserBean());
processMap.put("queryEntUserBean", new queryEntUserBean());
processMap.put("deleteEntUserBean", new deleteEntUserBean());
return processMap;
}
public static class queryAllEntUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, queryAllEntUser_args, List<EntUserBean>> {
public queryAllEntUser() {
super("queryAllEntUser");
}
public queryAllEntUser_args getEmptyArgsInstance() {
return new queryAllEntUser_args();
}
public AsyncMethodCallback<List<EntUserBean>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<List<EntUserBean>>() {
public void onComplete(List<EntUserBean> o) {
queryAllEntUser_result result = new queryAllEntUser_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
queryAllEntUser_result result = new queryAllEntUser_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, queryAllEntUser_args args, org.apache.thrift.async.AsyncMethodCallback<List<EntUserBean>> resultHandler) throws TException {
iface.queryAllEntUser(resultHandler);
}
}
public static class addEntUser<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, addEntUser_args, Integer> {
public addEntUser() {
super("addEntUser");
}
public addEntUser_args getEmptyArgsInstance() {
return new addEntUser_args();
}
public AsyncMethodCallback<Integer> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<Integer>() {
public void onComplete(Integer o) {
addEntUser_result result = new addEntUser_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
addEntUser_result result = new addEntUser_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, addEntUser_args args, org.apache.thrift.async.AsyncMethodCallback<Integer> resultHandler) throws TException {
iface.addEntUser(args.user,resultHandler);
}
}
public static class updateEntUserBean<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateEntUserBean_args, EntUserBean> {
public updateEntUserBean() {
super("updateEntUserBean");
}
public updateEntUserBean_args getEmptyArgsInstance() {
return new updateEntUserBean_args();
}
public AsyncMethodCallback<EntUserBean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<EntUserBean>() {
public void onComplete(EntUserBean o) {
updateEntUserBean_result result = new updateEntUserBean_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
updateEntUserBean_result result = new updateEntUserBean_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, updateEntUserBean_args args, org.apache.thrift.async.AsyncMethodCallback<EntUserBean> resultHandler) throws TException {
iface.updateEntUserBean(args.user,resultHandler);
}
}
public static class queryEntUserBean<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, queryEntUserBean_args, EntUserBean> {
public queryEntUserBean() {
super("queryEntUserBean");
}
public queryEntUserBean_args getEmptyArgsInstance() {
return new queryEntUserBean_args();
}
public AsyncMethodCallback<EntUserBean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<EntUserBean>() {
public void onComplete(EntUserBean o) {
queryEntUserBean_result result = new queryEntUserBean_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
queryEntUserBean_result result = new queryEntUserBean_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, queryEntUserBean_args args, org.apache.thrift.async.AsyncMethodCallback<EntUserBean> resultHandler) throws TException {
iface.queryEntUserBean(args.userID,resultHandler);
}
}
public static class deleteEntUserBean<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteEntUserBean_args, EntUserBean> {
public deleteEntUserBean() {
super("deleteEntUserBean");
}
public deleteEntUserBean_args getEmptyArgsInstance() {
return new deleteEntUserBean_args();
}
public AsyncMethodCallback<EntUserBean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback<EntUserBean>() {
public void onComplete(EntUserBean o) {
deleteEntUserBean_result result = new deleteEntUserBean_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
deleteEntUserBean_result result = new deleteEntUserBean_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, deleteEntUserBean_args args, org.apache.thrift.async.AsyncMethodCallback<EntUserBean> resultHandler) throws TException {
iface.deleteEntUserBean(args.userID,resultHandler);
}
}
}
public static class queryAllEntUser_args implements org.apache.thrift.TBase<queryAllEntUser_args, queryAllEntUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<queryAllEntUser_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryAllEntUser_args");
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new queryAllEntUser_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new queryAllEntUser_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(queryAllEntUser_args.class, metaDataMap);
}
public queryAllEntUser_args() {
}
/**
* Performs a deep copy on <i>other</i>.
*/
public queryAllEntUser_args(queryAllEntUser_args other) {
}
public queryAllEntUser_args deepCopy() {
return new queryAllEntUser_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 queryAllEntUser_args)
return this.equals((queryAllEntUser_args)that);
return false;
}
public boolean equals(queryAllEntUser_args that) {
if (that == null)
return false;
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
return list.hashCode();
}
@Override
public int compareTo(queryAllEntUser_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
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("queryAllEntUser_args(");
boolean first = true;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
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 queryAllEntUser_argsStandardSchemeFactory implements SchemeFactory {
public queryAllEntUser_argsStandardScheme getScheme() {
return new queryAllEntUser_argsStandardScheme();
}
}
private static class queryAllEntUser_argsStandardScheme extends StandardScheme<queryAllEntUser_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, queryAllEntUser_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, queryAllEntUser_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class queryAllEntUser_argsTupleSchemeFactory implements SchemeFactory {
public queryAllEntUser_argsTupleScheme getScheme() {
return new queryAllEntUser_argsTupleScheme();
}
}
private static class queryAllEntUser_argsTupleScheme extends TupleScheme<queryAllEntUser_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, queryAllEntUser_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, queryAllEntUser_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
}
}
}
public static class queryAllEntUser_result implements org.apache.thrift.TBase<queryAllEntUser_result, queryAllEntUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<queryAllEntUser_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryAllEntUser_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new queryAllEntUser_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new queryAllEntUser_resultTupleSchemeFactory());
}
public List<EntUserBean> 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.ListMetaData(org.apache.thrift.protocol.TType.LIST,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class))));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryAllEntUser_result.class, metaDataMap);
}
public queryAllEntUser_result() {
}
public queryAllEntUser_result(
List<EntUserBean> success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public queryAllEntUser_result(queryAllEntUser_result other) {
if (other.isSetSuccess()) {
List<EntUserBean> __this__success = new ArrayList<EntUserBean>(other.success.size());
for (EntUserBean other_element : other.success) {
__this__success.add(new EntUserBean(other_element));
}
this.success = __this__success;
}
}
public queryAllEntUser_result deepCopy() {
return new queryAllEntUser_result(this);
}
@Override
public void clear() {
this.success = null;
}
public int getSuccessSize() {
return (this.success == null) ? 0 : this.success.size();
}
public java.util.Iterator<EntUserBean> getSuccessIterator() {
return (this.success == null) ? null : this.success.iterator();
}
public void addToSuccess(EntUserBean elem) {
if (this.success == null) {
this.success = new ArrayList<EntUserBean>();
}
this.success.add(elem);
}
public List<EntUserBean> getSuccess() {
return this.success;
}
public queryAllEntUser_result setSuccess(List<EntUserBean> 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((List<EntUserBean>)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 queryAllEntUser_result)
return this.equals((queryAllEntUser_result)that);
return false;
}
public boolean equals(queryAllEntUser_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() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(queryAllEntUser_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("queryAllEntUser_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
// check for sub-struct validity
}
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 queryAllEntUser_resultStandardSchemeFactory implements SchemeFactory {
public queryAllEntUser_resultStandardScheme getScheme() {
return new queryAllEntUser_resultStandardScheme();
}
}
private static class queryAllEntUser_resultStandardScheme extends StandardScheme<queryAllEntUser_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, queryAllEntUser_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.LIST) {
{
org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
struct.success = new ArrayList<EntUserBean>(_list8.size);
EntUserBean _elem9;
for (int _i10 = 0; _i10 < _list8.size; ++_i10)
{
_elem9 = new EntUserBean();
_elem9.read(iprot);
struct.success.add(_elem9);
}
iprot.readListEnd();
}
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, queryAllEntUser_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.success != null) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
for (EntUserBean _iter11 : struct.success)
{
_iter11.write(oprot);
}
oprot.writeListEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class queryAllEntUser_resultTupleSchemeFactory implements SchemeFactory {
public queryAllEntUser_resultTupleScheme getScheme() {
return new queryAllEntUser_resultTupleScheme();
}
}
private static class queryAllEntUser_resultTupleScheme extends TupleScheme<queryAllEntUser_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, queryAllEntUser_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.writeI32(struct.success.size());
for (EntUserBean _iter12 : struct.success)
{
_iter12.write(oprot);
}
}
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, queryAllEntUser_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
struct.success = new ArrayList<EntUserBean>(_list13.size);
EntUserBean _elem14;
for (int _i15 = 0; _i15 < _list13.size; ++_i15)
{
_elem14 = new EntUserBean();
_elem14.read(iprot);
struct.success.add(_elem14);
}
}
struct.setSuccessIsSet(true);
}
}
}
}
public static class addEntUser_args implements org.apache.thrift.TBase<addEntUser_args, addEntUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<addEntUser_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addEntUser_args");
private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", 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 addEntUser_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new addEntUser_argsTupleSchemeFactory());
}
public EntUserBean user; // 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 {
USER((short)1, "user");
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: // USER
return USER;
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.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addEntUser_args.class, metaDataMap);
}
public addEntUser_args() {
}
public addEntUser_args(
EntUserBean user)
{
this();
this.user = user;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public addEntUser_args(addEntUser_args other) {
if (other.isSetUser()) {
this.user = new EntUserBean(other.user);
}
}
public addEntUser_args deepCopy() {
return new addEntUser_args(this);
}
@Override
public void clear() {
this.user = null;
}
public EntUserBean getUser() {
return this.user;
}
public addEntUser_args setUser(EntUserBean user) {
this.user = user;
return this;
}
public void unsetUser() {
this.user = null;
}
/** Returns true if field user is set (has been assigned a value) and false otherwise */
public boolean isSetUser() {
return this.user != null;
}
public void setUserIsSet(boolean value) {
if (!value) {
this.user = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USER:
if (value == null) {
unsetUser();
} else {
setUser((EntUserBean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USER:
return getUser();
}
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 USER:
return isSetUser();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof addEntUser_args)
return this.equals((addEntUser_args)that);
return false;
}
public boolean equals(addEntUser_args that) {
if (that == null)
return false;
boolean this_present_user = true && this.isSetUser();
boolean that_present_user = true && that.isSetUser();
if (this_present_user || that_present_user) {
if (!(this_present_user && that_present_user))
return false;
if (!this.user.equals(that.user))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_user = true && (isSetUser());
list.add(present_user);
if (present_user)
list.add(user);
return list.hashCode();
}
@Override
public int compareTo(addEntUser_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUser()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
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("addEntUser_args(");
boolean first = true;
sb.append("user:");
if (this.user == null) {
sb.append("null");
} else {
sb.append(this.user);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (user != null) {
user.validate();
}
}
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 addEntUser_argsStandardSchemeFactory implements SchemeFactory {
public addEntUser_argsStandardScheme getScheme() {
return new addEntUser_argsStandardScheme();
}
}
private static class addEntUser_argsStandardScheme extends StandardScheme<addEntUser_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, addEntUser_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: // USER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.user = new EntUserBean();
struct.user.read(iprot);
struct.setUserIsSet(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, addEntUser_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.user != null) {
oprot.writeFieldBegin(USER_FIELD_DESC);
struct.user.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class addEntUser_argsTupleSchemeFactory implements SchemeFactory {
public addEntUser_argsTupleScheme getScheme() {
return new addEntUser_argsTupleScheme();
}
}
private static class addEntUser_argsTupleScheme extends TupleScheme<addEntUser_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, addEntUser_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetUser()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetUser()) {
struct.user.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addEntUser_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.user = new EntUserBean();
struct.user.read(iprot);
struct.setUserIsSet(true);
}
}
}
}
public static class addEntUser_result implements org.apache.thrift.TBase<addEntUser_result, addEntUser_result._Fields>, java.io.Serializable, Cloneable, Comparable<addEntUser_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("addEntUser_result");
private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new addEntUser_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new addEntUser_resultTupleSchemeFactory());
}
public int 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
private static final int __SUCCESS_ISSET_ID = 0;
private byte __isset_bitfield = 0;
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.I32)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(addEntUser_result.class, metaDataMap);
}
public addEntUser_result() {
}
public addEntUser_result(
int success)
{
this();
this.success = success;
setSuccessIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public addEntUser_result(addEntUser_result other) {
__isset_bitfield = other.__isset_bitfield;
this.success = other.success;
}
public addEntUser_result deepCopy() {
return new addEntUser_result(this);
}
@Override
public void clear() {
setSuccessIsSet(false);
this.success = 0;
}
public int getSuccess() {
return this.success;
}
public addEntUser_result setSuccess(int success) {
this.success = success;
setSuccessIsSet(true);
return this;
}
public void unsetSuccess() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
/** Returns true if field success is set (has been assigned a value) and false otherwise */
public boolean isSetSuccess() {
return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID);
}
public void setSuccessIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SUCCESS:
if (value == null) {
unsetSuccess();
} else {
setSuccess((Integer)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 addEntUser_result)
return this.equals((addEntUser_result)that);
return false;
}
public boolean equals(addEntUser_result that) {
if (that == null)
return false;
boolean this_present_success = true;
boolean that_present_success = true;
if (this_present_success || that_present_success) {
if (!(this_present_success && that_present_success))
return false;
if (this.success != that.success)
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true;
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(addEntUser_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("addEntUser_result(");
boolean first = true;
sb.append("success:");
sb.append(this.success);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
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_bitfield = 0;
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 addEntUser_resultStandardSchemeFactory implements SchemeFactory {
public addEntUser_resultStandardScheme getScheme() {
return new addEntUser_resultStandardScheme();
}
}
private static class addEntUser_resultStandardScheme extends StandardScheme<addEntUser_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, addEntUser_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.I32) {
struct.success = iprot.readI32();
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, addEntUser_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.isSetSuccess()) {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
oprot.writeI32(struct.success);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class addEntUser_resultTupleSchemeFactory implements SchemeFactory {
public addEntUser_resultTupleScheme getScheme() {
return new addEntUser_resultTupleScheme();
}
}
private static class addEntUser_resultTupleScheme extends TupleScheme<addEntUser_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, addEntUser_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.writeI32(struct.success);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, addEntUser_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = iprot.readI32();
struct.setSuccessIsSet(true);
}
}
}
}
public static class updateEntUserBean_args implements org.apache.thrift.TBase<updateEntUserBean_args, updateEntUserBean_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateEntUserBean_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateEntUserBean_args");
private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", 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 updateEntUserBean_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new updateEntUserBean_argsTupleSchemeFactory());
}
public EntUserBean user; // 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 {
USER((short)1, "user");
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: // USER
return USER;
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.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateEntUserBean_args.class, metaDataMap);
}
public updateEntUserBean_args() {
}
public updateEntUserBean_args(
EntUserBean user)
{
this();
this.user = user;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateEntUserBean_args(updateEntUserBean_args other) {
if (other.isSetUser()) {
this.user = new EntUserBean(other.user);
}
}
public updateEntUserBean_args deepCopy() {
return new updateEntUserBean_args(this);
}
@Override
public void clear() {
this.user = null;
}
public EntUserBean getUser() {
return this.user;
}
public updateEntUserBean_args setUser(EntUserBean user) {
this.user = user;
return this;
}
public void unsetUser() {
this.user = null;
}
/** Returns true if field user is set (has been assigned a value) and false otherwise */
public boolean isSetUser() {
return this.user != null;
}
public void setUserIsSet(boolean value) {
if (!value) {
this.user = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USER:
if (value == null) {
unsetUser();
} else {
setUser((EntUserBean)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USER:
return getUser();
}
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 USER:
return isSetUser();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof updateEntUserBean_args)
return this.equals((updateEntUserBean_args)that);
return false;
}
public boolean equals(updateEntUserBean_args that) {
if (that == null)
return false;
boolean this_present_user = true && this.isSetUser();
boolean that_present_user = true && that.isSetUser();
if (this_present_user || that_present_user) {
if (!(this_present_user && that_present_user))
return false;
if (!this.user.equals(that.user))
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_user = true && (isSetUser());
list.add(present_user);
if (present_user)
list.add(user);
return list.hashCode();
}
@Override
public int compareTo(updateEntUserBean_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUser()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
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("updateEntUserBean_args(");
boolean first = true;
sb.append("user:");
if (this.user == null) {
sb.append("null");
} else {
sb.append(this.user);
}
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
if (user != null) {
user.validate();
}
}
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 updateEntUserBean_argsStandardSchemeFactory implements SchemeFactory {
public updateEntUserBean_argsStandardScheme getScheme() {
return new updateEntUserBean_argsStandardScheme();
}
}
private static class updateEntUserBean_argsStandardScheme extends StandardScheme<updateEntUserBean_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateEntUserBean_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: // USER
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.user = new EntUserBean();
struct.user.read(iprot);
struct.setUserIsSet(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, updateEntUserBean_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.user != null) {
oprot.writeFieldBegin(USER_FIELD_DESC);
struct.user.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateEntUserBean_argsTupleSchemeFactory implements SchemeFactory {
public updateEntUserBean_argsTupleScheme getScheme() {
return new updateEntUserBean_argsTupleScheme();
}
}
private static class updateEntUserBean_argsTupleScheme extends TupleScheme<updateEntUserBean_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetUser()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetUser()) {
struct.user.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.user = new EntUserBean();
struct.user.read(iprot);
struct.setUserIsSet(true);
}
}
}
}
public static class updateEntUserBean_result implements org.apache.thrift.TBase<updateEntUserBean_result, updateEntUserBean_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateEntUserBean_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateEntUserBean_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new updateEntUserBean_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new updateEntUserBean_resultTupleSchemeFactory());
}
public EntUserBean 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateEntUserBean_result.class, metaDataMap);
}
public updateEntUserBean_result() {
}
public updateEntUserBean_result(
EntUserBean success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public updateEntUserBean_result(updateEntUserBean_result other) {
if (other.isSetSuccess()) {
this.success = new EntUserBean(other.success);
}
}
public updateEntUserBean_result deepCopy() {
return new updateEntUserBean_result(this);
}
@Override
public void clear() {
this.success = null;
}
public EntUserBean getSuccess() {
return this.success;
}
public updateEntUserBean_result setSuccess(EntUserBean 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((EntUserBean)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 updateEntUserBean_result)
return this.equals((updateEntUserBean_result)that);
return false;
}
public boolean equals(updateEntUserBean_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() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(updateEntUserBean_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("updateEntUserBean_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
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
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 updateEntUserBean_resultStandardSchemeFactory implements SchemeFactory {
public updateEntUserBean_resultStandardScheme getScheme() {
return new updateEntUserBean_resultStandardScheme();
}
}
private static class updateEntUserBean_resultStandardScheme extends StandardScheme<updateEntUserBean_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, updateEntUserBean_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 EntUserBean();
struct.success.read(iprot);
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, updateEntUserBean_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();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class updateEntUserBean_resultTupleSchemeFactory implements SchemeFactory {
public updateEntUserBean_resultTupleScheme getScheme() {
return new updateEntUserBean_resultTupleScheme();
}
}
private static class updateEntUserBean_resultTupleScheme extends TupleScheme<updateEntUserBean_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, updateEntUserBean_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, updateEntUserBean_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new EntUserBean();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class queryEntUserBean_args implements org.apache.thrift.TBase<queryEntUserBean_args, queryEntUserBean_args._Fields>, java.io.Serializable, Cloneable, Comparable<queryEntUserBean_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryEntUserBean_args");
private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userID", org.apache.thrift.protocol.TType.I64, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new queryEntUserBean_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new queryEntUserBean_argsTupleSchemeFactory());
}
public long userID; // 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 {
USER_ID((short)1, "userID");
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: // USER_ID
return USER_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 __USERID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userID", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryEntUserBean_args.class, metaDataMap);
}
public queryEntUserBean_args() {
}
public queryEntUserBean_args(
long userID)
{
this();
this.userID = userID;
setUserIDIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public queryEntUserBean_args(queryEntUserBean_args other) {
__isset_bitfield = other.__isset_bitfield;
this.userID = other.userID;
}
public queryEntUserBean_args deepCopy() {
return new queryEntUserBean_args(this);
}
@Override
public void clear() {
setUserIDIsSet(false);
this.userID = 0;
}
public long getUserID() {
return this.userID;
}
public queryEntUserBean_args setUserID(long userID) {
this.userID = userID;
setUserIDIsSet(true);
return this;
}
public void unsetUserID() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID);
}
/** Returns true if field userID is set (has been assigned a value) and false otherwise */
public boolean isSetUserID() {
return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID);
}
public void setUserIDIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USER_ID:
if (value == null) {
unsetUserID();
} else {
setUserID((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USER_ID:
return getUserID();
}
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 USER_ID:
return isSetUserID();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof queryEntUserBean_args)
return this.equals((queryEntUserBean_args)that);
return false;
}
public boolean equals(queryEntUserBean_args that) {
if (that == null)
return false;
boolean this_present_userID = true;
boolean that_present_userID = true;
if (this_present_userID || that_present_userID) {
if (!(this_present_userID && that_present_userID))
return false;
if (this.userID != that.userID)
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_userID = true;
list.add(present_userID);
if (present_userID)
list.add(userID);
return list.hashCode();
}
@Override
public int compareTo(queryEntUserBean_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUserID()).compareTo(other.isSetUserID());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserID()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userID, other.userID);
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("queryEntUserBean_args(");
boolean first = true;
sb.append("userID:");
sb.append(this.userID);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
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_bitfield = 0;
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 queryEntUserBean_argsStandardSchemeFactory implements SchemeFactory {
public queryEntUserBean_argsStandardScheme getScheme() {
return new queryEntUserBean_argsStandardScheme();
}
}
private static class queryEntUserBean_argsStandardScheme extends StandardScheme<queryEntUserBean_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, queryEntUserBean_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: // USER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.userID = iprot.readI64();
struct.setUserIDIsSet(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, queryEntUserBean_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(USER_ID_FIELD_DESC);
oprot.writeI64(struct.userID);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class queryEntUserBean_argsTupleSchemeFactory implements SchemeFactory {
public queryEntUserBean_argsTupleScheme getScheme() {
return new queryEntUserBean_argsTupleScheme();
}
}
private static class queryEntUserBean_argsTupleScheme extends TupleScheme<queryEntUserBean_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, queryEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetUserID()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetUserID()) {
oprot.writeI64(struct.userID);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, queryEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.userID = iprot.readI64();
struct.setUserIDIsSet(true);
}
}
}
}
public static class queryEntUserBean_result implements org.apache.thrift.TBase<queryEntUserBean_result, queryEntUserBean_result._Fields>, java.io.Serializable, Cloneable, Comparable<queryEntUserBean_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("queryEntUserBean_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new queryEntUserBean_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new queryEntUserBean_resultTupleSchemeFactory());
}
public EntUserBean 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(queryEntUserBean_result.class, metaDataMap);
}
public queryEntUserBean_result() {
}
public queryEntUserBean_result(
EntUserBean success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public queryEntUserBean_result(queryEntUserBean_result other) {
if (other.isSetSuccess()) {
this.success = new EntUserBean(other.success);
}
}
public queryEntUserBean_result deepCopy() {
return new queryEntUserBean_result(this);
}
@Override
public void clear() {
this.success = null;
}
public EntUserBean getSuccess() {
return this.success;
}
public queryEntUserBean_result setSuccess(EntUserBean 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((EntUserBean)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 queryEntUserBean_result)
return this.equals((queryEntUserBean_result)that);
return false;
}
public boolean equals(queryEntUserBean_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() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(queryEntUserBean_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("queryEntUserBean_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
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
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 queryEntUserBean_resultStandardSchemeFactory implements SchemeFactory {
public queryEntUserBean_resultStandardScheme getScheme() {
return new queryEntUserBean_resultStandardScheme();
}
}
private static class queryEntUserBean_resultStandardScheme extends StandardScheme<queryEntUserBean_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, queryEntUserBean_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 EntUserBean();
struct.success.read(iprot);
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, queryEntUserBean_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();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class queryEntUserBean_resultTupleSchemeFactory implements SchemeFactory {
public queryEntUserBean_resultTupleScheme getScheme() {
return new queryEntUserBean_resultTupleScheme();
}
}
private static class queryEntUserBean_resultTupleScheme extends TupleScheme<queryEntUserBean_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, queryEntUserBean_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, queryEntUserBean_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new EntUserBean();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
public static class deleteEntUserBean_args implements org.apache.thrift.TBase<deleteEntUserBean_args, deleteEntUserBean_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteEntUserBean_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteEntUserBean_args");
private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userID", org.apache.thrift.protocol.TType.I64, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new deleteEntUserBean_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new deleteEntUserBean_argsTupleSchemeFactory());
}
public long userID; // 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 {
USER_ID((short)1, "userID");
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: // USER_ID
return USER_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 __USERID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userID", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteEntUserBean_args.class, metaDataMap);
}
public deleteEntUserBean_args() {
}
public deleteEntUserBean_args(
long userID)
{
this();
this.userID = userID;
setUserIDIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deleteEntUserBean_args(deleteEntUserBean_args other) {
__isset_bitfield = other.__isset_bitfield;
this.userID = other.userID;
}
public deleteEntUserBean_args deepCopy() {
return new deleteEntUserBean_args(this);
}
@Override
public void clear() {
setUserIDIsSet(false);
this.userID = 0;
}
public long getUserID() {
return this.userID;
}
public deleteEntUserBean_args setUserID(long userID) {
this.userID = userID;
setUserIDIsSet(true);
return this;
}
public void unsetUserID() {
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID);
}
/** Returns true if field userID is set (has been assigned a value) and false otherwise */
public boolean isSetUserID() {
return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID);
}
public void setUserIDIsSet(boolean value) {
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value);
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case USER_ID:
if (value == null) {
unsetUserID();
} else {
setUserID((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case USER_ID:
return getUserID();
}
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 USER_ID:
return isSetUserID();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof deleteEntUserBean_args)
return this.equals((deleteEntUserBean_args)that);
return false;
}
public boolean equals(deleteEntUserBean_args that) {
if (that == null)
return false;
boolean this_present_userID = true;
boolean that_present_userID = true;
if (this_present_userID || that_present_userID) {
if (!(this_present_userID && that_present_userID))
return false;
if (this.userID != that.userID)
return false;
}
return true;
}
@Override
public int hashCode() {
List<Object> list = new ArrayList<Object>();
boolean present_userID = true;
list.add(present_userID);
if (present_userID)
list.add(userID);
return list.hashCode();
}
@Override
public int compareTo(deleteEntUserBean_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetUserID()).compareTo(other.isSetUserID());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetUserID()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userID, other.userID);
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("deleteEntUserBean_args(");
boolean first = true;
sb.append("userID:");
sb.append(this.userID);
first = false;
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
// check for sub-struct validity
}
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_bitfield = 0;
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 deleteEntUserBean_argsStandardSchemeFactory implements SchemeFactory {
public deleteEntUserBean_argsStandardScheme getScheme() {
return new deleteEntUserBean_argsStandardScheme();
}
}
private static class deleteEntUserBean_argsStandardScheme extends StandardScheme<deleteEntUserBean_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteEntUserBean_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: // USER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.userID = iprot.readI64();
struct.setUserIDIsSet(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, deleteEntUserBean_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(USER_ID_FIELD_DESC);
oprot.writeI64(struct.userID);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deleteEntUserBean_argsTupleSchemeFactory implements SchemeFactory {
public deleteEntUserBean_argsTupleScheme getScheme() {
return new deleteEntUserBean_argsTupleScheme();
}
}
private static class deleteEntUserBean_argsTupleScheme extends TupleScheme<deleteEntUserBean_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deleteEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetUserID()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetUserID()) {
oprot.writeI64(struct.userID);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deleteEntUserBean_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.userID = iprot.readI64();
struct.setUserIDIsSet(true);
}
}
}
}
public static class deleteEntUserBean_result implements org.apache.thrift.TBase<deleteEntUserBean_result, deleteEntUserBean_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteEntUserBean_result> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteEntUserBean_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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new deleteEntUserBean_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new deleteEntUserBean_resultTupleSchemeFactory());
}
public EntUserBean 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.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, EntUserBean.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteEntUserBean_result.class, metaDataMap);
}
public deleteEntUserBean_result() {
}
public deleteEntUserBean_result(
EntUserBean success)
{
this();
this.success = success;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public deleteEntUserBean_result(deleteEntUserBean_result other) {
if (other.isSetSuccess()) {
this.success = new EntUserBean(other.success);
}
}
public deleteEntUserBean_result deepCopy() {
return new deleteEntUserBean_result(this);
}
@Override
public void clear() {
this.success = null;
}
public EntUserBean getSuccess() {
return this.success;
}
public deleteEntUserBean_result setSuccess(EntUserBean 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((EntUserBean)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 deleteEntUserBean_result)
return this.equals((deleteEntUserBean_result)that);
return false;
}
public boolean equals(deleteEntUserBean_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() {
List<Object> list = new ArrayList<Object>();
boolean present_success = true && (isSetSuccess());
list.add(present_success);
if (present_success)
list.add(success);
return list.hashCode();
}
@Override
public int compareTo(deleteEntUserBean_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetSuccess()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("deleteEntUserBean_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
// check for sub-struct validity
if (success != null) {
success.validate();
}
}
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 deleteEntUserBean_resultStandardSchemeFactory implements SchemeFactory {
public deleteEntUserBean_resultStandardScheme getScheme() {
return new deleteEntUserBean_resultStandardScheme();
}
}
private static class deleteEntUserBean_resultStandardScheme extends StandardScheme<deleteEntUserBean_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteEntUserBean_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 EntUserBean();
struct.success.read(iprot);
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, deleteEntUserBean_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();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class deleteEntUserBean_resultTupleSchemeFactory implements SchemeFactory {
public deleteEntUserBean_resultTupleScheme getScheme() {
return new deleteEntUserBean_resultTupleScheme();
}
}
private static class deleteEntUserBean_resultTupleScheme extends TupleScheme<deleteEntUserBean_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, deleteEntUserBean_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()) {
struct.success.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, deleteEntUserBean_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.success = new EntUserBean();
struct.success.read(iprot);
struct.setSuccessIsSet(true);
}
}
}
}
}
到此介绍了 thrift生成Java代码的方式和thrift的基础想信息。 具体实现服务和启动会在下次介绍。