/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package com.flaptor.indextank.rpc; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.thrift.*; import org.apache.thrift.async.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.transport.*; import org.apache.thrift.protocol.*; @SuppressWarnings("all") public class Searcher { public interface Iface { public ResultSet search(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters) throws IndextankException, InvalidQueryException, MissingQueryVariableException, TException; public int count(String query) throws IndextankException, TException; public int size() throws IndextankException, TException; public SearcherStats stats() throws IndextankException, TException; } public interface AsyncIface { public void search(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters, AsyncMethodCallback<AsyncClient.search_call> resultHandler) throws TException; public void count(String query, AsyncMethodCallback<AsyncClient.count_call> resultHandler) throws TException; public void size(AsyncMethodCallback<AsyncClient.size_call> resultHandler) throws TException; public void stats(AsyncMethodCallback<AsyncClient.stats_call> resultHandler) throws TException; } public static class Client implements TServiceClient, Iface { public static class Factory implements TServiceClientFactory<Client> { public Factory() {} public Client getClient(TProtocol prot) { return new Client(prot); } public Client getClient(TProtocol iprot, TProtocol oprot) { return new Client(iprot, oprot); } } public Client(TProtocol prot) { this(prot, prot); } public Client(TProtocol iprot, TProtocol oprot) { iprot_ = iprot; oprot_ = oprot; } protected TProtocol iprot_; protected TProtocol oprot_; protected int seqid_; public TProtocol getInputProtocol() { return this.iprot_; } public TProtocol getOutputProtocol() { return this.oprot_; } public ResultSet search(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters) throws IndextankException, InvalidQueryException, MissingQueryVariableException, TException { send_search(query, start, length, scoringFunctionIndex, query_variables, facetsFilter, variableRangeFilters, functionRangeFilters, extra_parameters); return recv_search(); } public void send_search(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters) throws TException { oprot_.writeMessageBegin(new TMessage("search", TMessageType.CALL, ++seqid_)); search_args args = new search_args(); args.set_query(query); args.set_start(start); args.set_length(length); args.set_scoringFunctionIndex(scoringFunctionIndex); args.set_query_variables(query_variables); args.set_facetsFilter(facetsFilter); args.set_variableRangeFilters(variableRangeFilters); args.set_functionRangeFilters(functionRangeFilters); args.set_extra_parameters(extra_parameters); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public ResultSet recv_search() throws IndextankException, InvalidQueryException, MissingQueryVariableException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "search failed: out of sequence response"); } search_result result = new search_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.is_set_success()) { return result.success; } if (result.ite != null) { throw result.ite; } if (result.iqe != null) { throw result.iqe; } if (result.qve != null) { throw result.qve; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "search failed: unknown result"); } public int count(String query) throws IndextankException, TException { send_count(query); return recv_count(); } public void send_count(String query) throws TException { oprot_.writeMessageBegin(new TMessage("count", TMessageType.CALL, ++seqid_)); count_args args = new count_args(); args.set_query(query); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public int recv_count() throws IndextankException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "count failed: out of sequence response"); } count_result result = new count_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.is_set_success()) { return result.success; } if (result.ite != null) { throw result.ite; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "count failed: unknown result"); } public int size() throws IndextankException, TException { send_size(); return recv_size(); } public void send_size() throws TException { oprot_.writeMessageBegin(new TMessage("size", TMessageType.CALL, ++seqid_)); size_args args = new size_args(); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public int recv_size() throws IndextankException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "size failed: out of sequence response"); } size_result result = new size_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.is_set_success()) { return result.success; } if (result.ite != null) { throw result.ite; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "size failed: unknown result"); } public SearcherStats stats() throws IndextankException, TException { send_stats(); return recv_stats(); } public void send_stats() throws TException { oprot_.writeMessageBegin(new TMessage("stats", TMessageType.CALL, ++seqid_)); stats_args args = new stats_args(); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public SearcherStats recv_stats() throws IndextankException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "stats failed: out of sequence response"); } stats_result result = new stats_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.is_set_success()) { return result.success; } if (result.ite != null) { throw result.ite; } throw new TApplicationException(TApplicationException.MISSING_RESULT, "stats failed: unknown result"); } } public static class AsyncClient extends TAsyncClient implements AsyncIface { public static class Factory implements TAsyncClientFactory<AsyncClient> { private TAsyncClientManager clientManager; private TProtocolFactory protocolFactory; public Factory(TAsyncClientManager clientManager, TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientManager, TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void search(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters, AsyncMethodCallback<search_call> resultHandler) throws TException { checkReady(); search_call method_call = new search_call(query, start, length, scoringFunctionIndex, query_variables, facetsFilter, variableRangeFilters, functionRangeFilters, extra_parameters, resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class search_call extends TAsyncMethodCall { private String query; private int start; private int length; private int scoringFunctionIndex; private Map<Integer,Double> query_variables; private List<CategoryFilter> facetsFilter; private List<RangeFilter> variableRangeFilters; private List<RangeFilter> functionRangeFilters; private Map<String,String> extra_parameters; public search_call(String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters, AsyncMethodCallback<search_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); this.query = query; this.start = start; this.length = length; this.scoringFunctionIndex = scoringFunctionIndex; this.query_variables = query_variables; this.facetsFilter = facetsFilter; this.variableRangeFilters = variableRangeFilters; this.functionRangeFilters = functionRangeFilters; this.extra_parameters = extra_parameters; } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("search", TMessageType.CALL, 0)); search_args args = new search_args(); args.set_query(query); args.set_start(start); args.set_length(length); args.set_scoringFunctionIndex(scoringFunctionIndex); args.set_query_variables(query_variables); args.set_facetsFilter(facetsFilter); args.set_variableRangeFilters(variableRangeFilters); args.set_functionRangeFilters(functionRangeFilters); args.set_extra_parameters(extra_parameters); args.write(prot); prot.writeMessageEnd(); } public ResultSet getResult() throws IndextankException, InvalidQueryException, MissingQueryVariableException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_search(); } } public void count(String query, AsyncMethodCallback<count_call> resultHandler) throws TException { checkReady(); count_call method_call = new count_call(query, resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class count_call extends TAsyncMethodCall { private String query; public count_call(String query, AsyncMethodCallback<count_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); this.query = query; } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("count", TMessageType.CALL, 0)); count_args args = new count_args(); args.set_query(query); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws IndextankException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_count(); } } public void size(AsyncMethodCallback<size_call> resultHandler) throws TException { checkReady(); size_call method_call = new size_call(resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class size_call extends TAsyncMethodCall { public size_call(AsyncMethodCallback<size_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("size", TMessageType.CALL, 0)); size_args args = new size_args(); args.write(prot); prot.writeMessageEnd(); } public int getResult() throws IndextankException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_size(); } } public void stats(AsyncMethodCallback<stats_call> resultHandler) throws TException { checkReady(); stats_call method_call = new stats_call(resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class stats_call extends TAsyncMethodCall { public stats_call(AsyncMethodCallback<stats_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("stats", TMessageType.CALL, 0)); stats_args args = new stats_args(); args.write(prot); prot.writeMessageEnd(); } public SearcherStats getResult() throws IndextankException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_stats(); } } } public static class Processor implements TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(Iface iface) { iface_ = iface; processMap_.put("search", new search()); processMap_.put("count", new count()); processMap_.put("size", new size()); processMap_.put("stats", new stats()); } protected static interface ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; } private Iface iface_; protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>(); public boolean process(TProtocol iprot, TProtocol oprot) throws TException { TMessage msg = iprot.readMessageBegin(); ProcessFunction fn = processMap_.get(msg.name); if (fn == null) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return true; } fn.process(msg.seqid, iprot, oprot); return true; } private class search implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { search_args args = new search_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("search", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); search_result result = new search_result(); try { result.success = iface_.search(args.query, args.start, args.length, args.scoringFunctionIndex, args.query_variables, args.facetsFilter, args.variableRangeFilters, args.functionRangeFilters, args.extra_parameters); } catch (IndextankException ite) { result.ite = ite; } catch (InvalidQueryException iqe) { result.iqe = iqe; } catch (MissingQueryVariableException qve) { result.qve = qve; } catch (Throwable th) { LOGGER.error("Internal error processing search", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing search"); oprot.writeMessageBegin(new TMessage("search", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("search", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class count implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { count_args args = new count_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("count", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); count_result result = new count_result(); try { result.success = iface_.count(args.query); result.set_success_isSet(true); } catch (IndextankException ite) { result.ite = ite; } catch (Throwable th) { LOGGER.error("Internal error processing count", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing count"); oprot.writeMessageBegin(new TMessage("count", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("count", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class size implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { size_args args = new size_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("size", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); size_result result = new size_result(); try { result.success = iface_.size(); result.set_success_isSet(true); } catch (IndextankException ite) { result.ite = ite; } catch (Throwable th) { LOGGER.error("Internal error processing size", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing size"); oprot.writeMessageBegin(new TMessage("size", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("size", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class stats implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { stats_args args = new stats_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("stats", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); stats_result result = new stats_result(); try { result.success = iface_.stats(); } catch (IndextankException ite) { result.ite = ite; } catch (Throwable th) { LOGGER.error("Internal error processing stats", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing stats"); oprot.writeMessageBegin(new TMessage("stats", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("stats", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } } public static class search_args implements TBase<search_args, search_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("search_args"); private static final TField QUERY_FIELD_DESC = new TField("query", TType.STRING, (short)1); private static final TField START_FIELD_DESC = new TField("start", TType.I32, (short)2); private static final TField LENGTH_FIELD_DESC = new TField("length", TType.I32, (short)3); private static final TField SCORING_FUNCTION_INDEX_FIELD_DESC = new TField("scoringFunctionIndex", TType.I32, (short)4); private static final TField QUERY_VARIABLES_FIELD_DESC = new TField("query_variables", TType.MAP, (short)6); private static final TField FACETS_FILTER_FIELD_DESC = new TField("facetsFilter", TType.LIST, (short)7); private static final TField VARIABLE_RANGE_FILTERS_FIELD_DESC = new TField("variableRangeFilters", TType.LIST, (short)8); private static final TField FUNCTION_RANGE_FILTERS_FIELD_DESC = new TField("functionRangeFilters", TType.LIST, (short)9); private static final TField EXTRA_PARAMETERS_FIELD_DESC = new TField("extra_parameters", TType.MAP, (short)5); private String query; private int start; private int length; private int scoringFunctionIndex; private Map<Integer,Double> query_variables; private List<CategoryFilter> facetsFilter; private List<RangeFilter> variableRangeFilters; private List<RangeFilter> functionRangeFilters; private Map<String,String> extra_parameters; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { QUERY((short)1, "query"), START((short)2, "start"), LENGTH((short)3, "length"), SCORING_FUNCTION_INDEX((short)4, "scoringFunctionIndex"), QUERY_VARIABLES((short)6, "query_variables"), FACETS_FILTER((short)7, "facetsFilter"), VARIABLE_RANGE_FILTERS((short)8, "variableRangeFilters"), FUNCTION_RANGE_FILTERS((short)9, "functionRangeFilters"), EXTRA_PARAMETERS((short)5, "extra_parameters"); 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: // QUERY return QUERY; case 2: // START return START; case 3: // LENGTH return LENGTH; case 4: // SCORING_FUNCTION_INDEX return SCORING_FUNCTION_INDEX; case 6: // QUERY_VARIABLES return QUERY_VARIABLES; case 7: // FACETS_FILTER return FACETS_FILTER; case 8: // VARIABLE_RANGE_FILTERS return VARIABLE_RANGE_FILTERS; case 9: // FUNCTION_RANGE_FILTERS return FUNCTION_RANGE_FILTERS; case 5: // EXTRA_PARAMETERS return EXTRA_PARAMETERS; 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 __START_ISSET_ID = 0; private static final int __LENGTH_ISSET_ID = 1; private static final int __SCORINGFUNCTIONINDEX_ISSET_ID = 2; private BitSet __isset_bit_vector = new BitSet(3); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUERY, new FieldMetaData("query", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); tmpMap.put(_Fields.START, new FieldMetaData("start", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.LENGTH, new FieldMetaData("length", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.SCORING_FUNCTION_INDEX, new FieldMetaData("scoringFunctionIndex", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.QUERY_VARIABLES, new FieldMetaData("query_variables", TFieldRequirementType.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.I32), new FieldValueMetaData(TType.DOUBLE)))); tmpMap.put(_Fields.FACETS_FILTER, new FieldMetaData("facetsFilter", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, CategoryFilter.class)))); tmpMap.put(_Fields.VARIABLE_RANGE_FILTERS, new FieldMetaData("variableRangeFilters", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, RangeFilter.class)))); tmpMap.put(_Fields.FUNCTION_RANGE_FILTERS, new FieldMetaData("functionRangeFilters", TFieldRequirementType.DEFAULT, new ListMetaData(TType.LIST, new StructMetaData(TType.STRUCT, RangeFilter.class)))); tmpMap.put(_Fields.EXTRA_PARAMETERS, new FieldMetaData("extra_parameters", TFieldRequirementType.DEFAULT, new MapMetaData(TType.MAP, new FieldValueMetaData(TType.STRING), new FieldValueMetaData(TType.STRING)))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(search_args.class, metaDataMap); } public search_args() { this.query_variables = new HashMap<Integer,Double>(); this.facetsFilter = new ArrayList<CategoryFilter>(); this.variableRangeFilters = new ArrayList<RangeFilter>(); this.functionRangeFilters = new ArrayList<RangeFilter>(); } public search_args( String query, int start, int length, int scoringFunctionIndex, Map<Integer,Double> query_variables, List<CategoryFilter> facetsFilter, List<RangeFilter> variableRangeFilters, List<RangeFilter> functionRangeFilters, Map<String,String> extra_parameters) { this(); this.query = query; this.start = start; set_start_isSet(true); this.length = length; set_length_isSet(true); this.scoringFunctionIndex = scoringFunctionIndex; set_scoringFunctionIndex_isSet(true); this.query_variables = query_variables; this.facetsFilter = facetsFilter; this.variableRangeFilters = variableRangeFilters; this.functionRangeFilters = functionRangeFilters; this.extra_parameters = extra_parameters; } /** * Performs a deep copy on <i>other</i>. */ public search_args(search_args other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); if (other.is_set_query()) { this.query = other.query; } this.start = other.start; this.length = other.length; this.scoringFunctionIndex = other.scoringFunctionIndex; if (other.is_set_query_variables()) { Map<Integer,Double> __this__query_variables = new HashMap<Integer,Double>(); for (Map.Entry<Integer, Double> other_element : other.query_variables.entrySet()) { Integer other_element_key = other_element.getKey(); Double other_element_value = other_element.getValue(); Integer __this__query_variables_copy_key = other_element_key; Double __this__query_variables_copy_value = other_element_value; __this__query_variables.put(__this__query_variables_copy_key, __this__query_variables_copy_value); } this.query_variables = __this__query_variables; } if (other.is_set_facetsFilter()) { List<CategoryFilter> __this__facetsFilter = new ArrayList<CategoryFilter>(); for (CategoryFilter other_element : other.facetsFilter) { __this__facetsFilter.add(new CategoryFilter(other_element)); } this.facetsFilter = __this__facetsFilter; } if (other.is_set_variableRangeFilters()) { List<RangeFilter> __this__variableRangeFilters = new ArrayList<RangeFilter>(); for (RangeFilter other_element : other.variableRangeFilters) { __this__variableRangeFilters.add(new RangeFilter(other_element)); } this.variableRangeFilters = __this__variableRangeFilters; } if (other.is_set_functionRangeFilters()) { List<RangeFilter> __this__functionRangeFilters = new ArrayList<RangeFilter>(); for (RangeFilter other_element : other.functionRangeFilters) { __this__functionRangeFilters.add(new RangeFilter(other_element)); } this.functionRangeFilters = __this__functionRangeFilters; } if (other.is_set_extra_parameters()) { Map<String,String> __this__extra_parameters = new HashMap<String,String>(); for (Map.Entry<String, String> other_element : other.extra_parameters.entrySet()) { String other_element_key = other_element.getKey(); String other_element_value = other_element.getValue(); String __this__extra_parameters_copy_key = other_element_key; String __this__extra_parameters_copy_value = other_element_value; __this__extra_parameters.put(__this__extra_parameters_copy_key, __this__extra_parameters_copy_value); } this.extra_parameters = __this__extra_parameters; } } public search_args deepCopy() { return new search_args(this); } @Override public void clear() { this.query = null; set_start_isSet(false); this.start = 0; set_length_isSet(false); this.length = 0; set_scoringFunctionIndex_isSet(false); this.scoringFunctionIndex = 0; this.query_variables = new HashMap<Integer,Double>(); this.facetsFilter = new ArrayList<CategoryFilter>(); this.variableRangeFilters = new ArrayList<RangeFilter>(); this.functionRangeFilters = new ArrayList<RangeFilter>(); this.extra_parameters = null; } public String get_query() { return this.query; } public search_args set_query(String query) { this.query = query; return this; } public void unset_query() { this.query = null; } /** Returns true if field query is set (has been asigned a value) and false otherwise */ public boolean is_set_query() { return this.query != null; } public void set_query_isSet(boolean value) { if (!value) { this.query = null; } } public int get_start() { return this.start; } public search_args set_start(int start) { this.start = start; set_start_isSet(true); return this; } public void unset_start() { __isset_bit_vector.clear(__START_ISSET_ID); } /** Returns true if field start is set (has been asigned a value) and false otherwise */ public boolean is_set_start() { return __isset_bit_vector.get(__START_ISSET_ID); } public void set_start_isSet(boolean value) { __isset_bit_vector.set(__START_ISSET_ID, value); } public int get_length() { return this.length; } public search_args set_length(int length) { this.length = length; set_length_isSet(true); return this; } public void unset_length() { __isset_bit_vector.clear(__LENGTH_ISSET_ID); } /** Returns true if field length is set (has been asigned a value) and false otherwise */ public boolean is_set_length() { return __isset_bit_vector.get(__LENGTH_ISSET_ID); } public void set_length_isSet(boolean value) { __isset_bit_vector.set(__LENGTH_ISSET_ID, value); } public int get_scoringFunctionIndex() { return this.scoringFunctionIndex; } public search_args set_scoringFunctionIndex(int scoringFunctionIndex) { this.scoringFunctionIndex = scoringFunctionIndex; set_scoringFunctionIndex_isSet(true); return this; } public void unset_scoringFunctionIndex() { __isset_bit_vector.clear(__SCORINGFUNCTIONINDEX_ISSET_ID); } /** Returns true if field scoringFunctionIndex is set (has been asigned a value) and false otherwise */ public boolean is_set_scoringFunctionIndex() { return __isset_bit_vector.get(__SCORINGFUNCTIONINDEX_ISSET_ID); } public void set_scoringFunctionIndex_isSet(boolean value) { __isset_bit_vector.set(__SCORINGFUNCTIONINDEX_ISSET_ID, value); } public int get_query_variables_size() { return (this.query_variables == null) ? 0 : this.query_variables.size(); } public void put_to_query_variables(int key, double val) { if (this.query_variables == null) { this.query_variables = new HashMap<Integer,Double>(); } this.query_variables.put(key, val); } public Map<Integer,Double> get_query_variables() { return this.query_variables; } public search_args set_query_variables(Map<Integer,Double> query_variables) { this.query_variables = query_variables; return this; } public void unset_query_variables() { this.query_variables = null; } /** Returns true if field query_variables is set (has been asigned a value) and false otherwise */ public boolean is_set_query_variables() { return this.query_variables != null; } public void set_query_variables_isSet(boolean value) { if (!value) { this.query_variables = null; } } public int get_facetsFilter_size() { return (this.facetsFilter == null) ? 0 : this.facetsFilter.size(); } public java.util.Iterator<CategoryFilter> get_facetsFilter_iterator() { return (this.facetsFilter == null) ? null : this.facetsFilter.iterator(); } public void add_to_facetsFilter(CategoryFilter elem) { if (this.facetsFilter == null) { this.facetsFilter = new ArrayList<CategoryFilter>(); } this.facetsFilter.add(elem); } public List<CategoryFilter> get_facetsFilter() { return this.facetsFilter; } public search_args set_facetsFilter(List<CategoryFilter> facetsFilter) { this.facetsFilter = facetsFilter; return this; } public void unset_facetsFilter() { this.facetsFilter = null; } /** Returns true if field facetsFilter is set (has been asigned a value) and false otherwise */ public boolean is_set_facetsFilter() { return this.facetsFilter != null; } public void set_facetsFilter_isSet(boolean value) { if (!value) { this.facetsFilter = null; } } public int get_variableRangeFilters_size() { return (this.variableRangeFilters == null) ? 0 : this.variableRangeFilters.size(); } public java.util.Iterator<RangeFilter> get_variableRangeFilters_iterator() { return (this.variableRangeFilters == null) ? null : this.variableRangeFilters.iterator(); } public void add_to_variableRangeFilters(RangeFilter elem) { if (this.variableRangeFilters == null) { this.variableRangeFilters = new ArrayList<RangeFilter>(); } this.variableRangeFilters.add(elem); } public List<RangeFilter> get_variableRangeFilters() { return this.variableRangeFilters; } public search_args set_variableRangeFilters(List<RangeFilter> variableRangeFilters) { this.variableRangeFilters = variableRangeFilters; return this; } public void unset_variableRangeFilters() { this.variableRangeFilters = null; } /** Returns true if field variableRangeFilters is set (has been asigned a value) and false otherwise */ public boolean is_set_variableRangeFilters() { return this.variableRangeFilters != null; } public void set_variableRangeFilters_isSet(boolean value) { if (!value) { this.variableRangeFilters = null; } } public int get_functionRangeFilters_size() { return (this.functionRangeFilters == null) ? 0 : this.functionRangeFilters.size(); } public java.util.Iterator<RangeFilter> get_functionRangeFilters_iterator() { return (this.functionRangeFilters == null) ? null : this.functionRangeFilters.iterator(); } public void add_to_functionRangeFilters(RangeFilter elem) { if (this.functionRangeFilters == null) { this.functionRangeFilters = new ArrayList<RangeFilter>(); } this.functionRangeFilters.add(elem); } public List<RangeFilter> get_functionRangeFilters() { return this.functionRangeFilters; } public search_args set_functionRangeFilters(List<RangeFilter> functionRangeFilters) { this.functionRangeFilters = functionRangeFilters; return this; } public void unset_functionRangeFilters() { this.functionRangeFilters = null; } /** Returns true if field functionRangeFilters is set (has been asigned a value) and false otherwise */ public boolean is_set_functionRangeFilters() { return this.functionRangeFilters != null; } public void set_functionRangeFilters_isSet(boolean value) { if (!value) { this.functionRangeFilters = null; } } public int get_extra_parameters_size() { return (this.extra_parameters == null) ? 0 : this.extra_parameters.size(); } public void put_to_extra_parameters(String key, String val) { if (this.extra_parameters == null) { this.extra_parameters = new HashMap<String,String>(); } this.extra_parameters.put(key, val); } public Map<String,String> get_extra_parameters() { return this.extra_parameters; } public search_args set_extra_parameters(Map<String,String> extra_parameters) { this.extra_parameters = extra_parameters; return this; } public void unset_extra_parameters() { this.extra_parameters = null; } /** Returns true if field extra_parameters is set (has been asigned a value) and false otherwise */ public boolean is_set_extra_parameters() { return this.extra_parameters != null; } public void set_extra_parameters_isSet(boolean value) { if (!value) { this.extra_parameters = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case QUERY: if (value == null) { unset_query(); } else { set_query((String)value); } break; case START: if (value == null) { unset_start(); } else { set_start((Integer)value); } break; case LENGTH: if (value == null) { unset_length(); } else { set_length((Integer)value); } break; case SCORING_FUNCTION_INDEX: if (value == null) { unset_scoringFunctionIndex(); } else { set_scoringFunctionIndex((Integer)value); } break; case QUERY_VARIABLES: if (value == null) { unset_query_variables(); } else { set_query_variables((Map<Integer,Double>)value); } break; case FACETS_FILTER: if (value == null) { unset_facetsFilter(); } else { set_facetsFilter((List<CategoryFilter>)value); } break; case VARIABLE_RANGE_FILTERS: if (value == null) { unset_variableRangeFilters(); } else { set_variableRangeFilters((List<RangeFilter>)value); } break; case FUNCTION_RANGE_FILTERS: if (value == null) { unset_functionRangeFilters(); } else { set_functionRangeFilters((List<RangeFilter>)value); } break; case EXTRA_PARAMETERS: if (value == null) { unset_extra_parameters(); } else { set_extra_parameters((Map<String,String>)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case QUERY: return get_query(); case START: return new Integer(get_start()); case LENGTH: return new Integer(get_length()); case SCORING_FUNCTION_INDEX: return new Integer(get_scoringFunctionIndex()); case QUERY_VARIABLES: return get_query_variables(); case FACETS_FILTER: return get_facetsFilter(); case VARIABLE_RANGE_FILTERS: return get_variableRangeFilters(); case FUNCTION_RANGE_FILTERS: return get_functionRangeFilters(); case EXTRA_PARAMETERS: return get_extra_parameters(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case QUERY: return is_set_query(); case START: return is_set_start(); case LENGTH: return is_set_length(); case SCORING_FUNCTION_INDEX: return is_set_scoringFunctionIndex(); case QUERY_VARIABLES: return is_set_query_variables(); case FACETS_FILTER: return is_set_facetsFilter(); case VARIABLE_RANGE_FILTERS: return is_set_variableRangeFilters(); case FUNCTION_RANGE_FILTERS: return is_set_functionRangeFilters(); case EXTRA_PARAMETERS: return is_set_extra_parameters(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof search_args) return this.equals((search_args)that); return false; } public boolean equals(search_args that) { if (that == null) return false; boolean this_present_query = true && this.is_set_query(); boolean that_present_query = true && that.is_set_query(); if (this_present_query || that_present_query) { if (!(this_present_query && that_present_query)) return false; if (!this.query.equals(that.query)) return false; } boolean this_present_start = true; boolean that_present_start = true; if (this_present_start || that_present_start) { if (!(this_present_start && that_present_start)) return false; if (this.start != that.start) return false; } boolean this_present_length = true; boolean that_present_length = true; if (this_present_length || that_present_length) { if (!(this_present_length && that_present_length)) return false; if (this.length != that.length) return false; } boolean this_present_scoringFunctionIndex = true; boolean that_present_scoringFunctionIndex = true; if (this_present_scoringFunctionIndex || that_present_scoringFunctionIndex) { if (!(this_present_scoringFunctionIndex && that_present_scoringFunctionIndex)) return false; if (this.scoringFunctionIndex != that.scoringFunctionIndex) return false; } boolean this_present_query_variables = true && this.is_set_query_variables(); boolean that_present_query_variables = true && that.is_set_query_variables(); if (this_present_query_variables || that_present_query_variables) { if (!(this_present_query_variables && that_present_query_variables)) return false; if (!this.query_variables.equals(that.query_variables)) return false; } boolean this_present_facetsFilter = true && this.is_set_facetsFilter(); boolean that_present_facetsFilter = true && that.is_set_facetsFilter(); if (this_present_facetsFilter || that_present_facetsFilter) { if (!(this_present_facetsFilter && that_present_facetsFilter)) return false; if (!this.facetsFilter.equals(that.facetsFilter)) return false; } boolean this_present_variableRangeFilters = true && this.is_set_variableRangeFilters(); boolean that_present_variableRangeFilters = true && that.is_set_variableRangeFilters(); if (this_present_variableRangeFilters || that_present_variableRangeFilters) { if (!(this_present_variableRangeFilters && that_present_variableRangeFilters)) return false; if (!this.variableRangeFilters.equals(that.variableRangeFilters)) return false; } boolean this_present_functionRangeFilters = true && this.is_set_functionRangeFilters(); boolean that_present_functionRangeFilters = true && that.is_set_functionRangeFilters(); if (this_present_functionRangeFilters || that_present_functionRangeFilters) { if (!(this_present_functionRangeFilters && that_present_functionRangeFilters)) return false; if (!this.functionRangeFilters.equals(that.functionRangeFilters)) return false; } boolean this_present_extra_parameters = true && this.is_set_extra_parameters(); boolean that_present_extra_parameters = true && that.is_set_extra_parameters(); if (this_present_extra_parameters || that_present_extra_parameters) { if (!(this_present_extra_parameters && that_present_extra_parameters)) return false; if (!this.extra_parameters.equals(that.extra_parameters)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(search_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; search_args typedOther = (search_args)other; lastComparison = Boolean.valueOf(is_set_query()).compareTo(typedOther.is_set_query()); if (lastComparison != 0) { return lastComparison; } if (is_set_query()) { lastComparison = TBaseHelper.compareTo(this.query, typedOther.query); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_start()).compareTo(typedOther.is_set_start()); if (lastComparison != 0) { return lastComparison; } if (is_set_start()) { lastComparison = TBaseHelper.compareTo(this.start, typedOther.start); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_length()).compareTo(typedOther.is_set_length()); if (lastComparison != 0) { return lastComparison; } if (is_set_length()) { lastComparison = TBaseHelper.compareTo(this.length, typedOther.length); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_scoringFunctionIndex()).compareTo(typedOther.is_set_scoringFunctionIndex()); if (lastComparison != 0) { return lastComparison; } if (is_set_scoringFunctionIndex()) { lastComparison = TBaseHelper.compareTo(this.scoringFunctionIndex, typedOther.scoringFunctionIndex); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_query_variables()).compareTo(typedOther.is_set_query_variables()); if (lastComparison != 0) { return lastComparison; } if (is_set_query_variables()) { lastComparison = TBaseHelper.compareTo(this.query_variables, typedOther.query_variables); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_facetsFilter()).compareTo(typedOther.is_set_facetsFilter()); if (lastComparison != 0) { return lastComparison; } if (is_set_facetsFilter()) { lastComparison = TBaseHelper.compareTo(this.facetsFilter, typedOther.facetsFilter); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_variableRangeFilters()).compareTo(typedOther.is_set_variableRangeFilters()); if (lastComparison != 0) { return lastComparison; } if (is_set_variableRangeFilters()) { lastComparison = TBaseHelper.compareTo(this.variableRangeFilters, typedOther.variableRangeFilters); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_functionRangeFilters()).compareTo(typedOther.is_set_functionRangeFilters()); if (lastComparison != 0) { return lastComparison; } if (is_set_functionRangeFilters()) { lastComparison = TBaseHelper.compareTo(this.functionRangeFilters, typedOther.functionRangeFilters); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_extra_parameters()).compareTo(typedOther.is_set_extra_parameters()); if (lastComparison != 0) { return lastComparison; } if (is_set_extra_parameters()) { lastComparison = TBaseHelper.compareTo(this.extra_parameters, typedOther.extra_parameters); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // QUERY if (field.type == TType.STRING) { this.query = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // START if (field.type == TType.I32) { this.start = iprot.readI32(); set_start_isSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 3: // LENGTH if (field.type == TType.I32) { this.length = iprot.readI32(); set_length_isSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 4: // SCORING_FUNCTION_INDEX if (field.type == TType.I32) { this.scoringFunctionIndex = iprot.readI32(); set_scoringFunctionIndex_isSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 6: // QUERY_VARIABLES if (field.type == TType.MAP) { { TMap _map94 = iprot.readMapBegin(); this.query_variables = new HashMap<Integer,Double>(2*_map94.size); for (int _i95 = 0; _i95 < _map94.size; ++_i95) { int _key96; double _val97; _key96 = iprot.readI32(); _val97 = iprot.readDouble(); this.query_variables.put(_key96, _val97); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 7: // FACETS_FILTER if (field.type == TType.LIST) { { TList _list98 = iprot.readListBegin(); this.facetsFilter = new ArrayList<CategoryFilter>(_list98.size); for (int _i99 = 0; _i99 < _list98.size; ++_i99) { CategoryFilter _elem100; _elem100 = new CategoryFilter(); _elem100.read(iprot); this.facetsFilter.add(_elem100); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 8: // VARIABLE_RANGE_FILTERS if (field.type == TType.LIST) { { TList _list101 = iprot.readListBegin(); this.variableRangeFilters = new ArrayList<RangeFilter>(_list101.size); for (int _i102 = 0; _i102 < _list101.size; ++_i102) { RangeFilter _elem103; _elem103 = new RangeFilter(); _elem103.read(iprot); this.variableRangeFilters.add(_elem103); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 9: // FUNCTION_RANGE_FILTERS if (field.type == TType.LIST) { { TList _list104 = iprot.readListBegin(); this.functionRangeFilters = new ArrayList<RangeFilter>(_list104.size); for (int _i105 = 0; _i105 < _list104.size; ++_i105) { RangeFilter _elem106; _elem106 = new RangeFilter(); _elem106.read(iprot); this.functionRangeFilters.add(_elem106); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 5: // EXTRA_PARAMETERS if (field.type == TType.MAP) { { TMap _map107 = iprot.readMapBegin(); this.extra_parameters = new HashMap<String,String>(2*_map107.size); for (int _i108 = 0; _i108 < _map107.size; ++_i108) { String _key109; String _val110; _key109 = iprot.readString(); _val110 = iprot.readString(); this.extra_parameters.put(_key109, _val110); } iprot.readMapEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.query != null) { oprot.writeFieldBegin(QUERY_FIELD_DESC); oprot.writeString(this.query); oprot.writeFieldEnd(); } oprot.writeFieldBegin(START_FIELD_DESC); oprot.writeI32(this.start); oprot.writeFieldEnd(); oprot.writeFieldBegin(LENGTH_FIELD_DESC); oprot.writeI32(this.length); oprot.writeFieldEnd(); oprot.writeFieldBegin(SCORING_FUNCTION_INDEX_FIELD_DESC); oprot.writeI32(this.scoringFunctionIndex); oprot.writeFieldEnd(); if (this.extra_parameters != null) { oprot.writeFieldBegin(EXTRA_PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.extra_parameters.size())); for (Map.Entry<String, String> _iter111 : this.extra_parameters.entrySet()) { oprot.writeString(_iter111.getKey()); oprot.writeString(_iter111.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (this.query_variables != null) { oprot.writeFieldBegin(QUERY_VARIABLES_FIELD_DESC); { oprot.writeMapBegin(new TMap(TType.I32, TType.DOUBLE, this.query_variables.size())); for (Map.Entry<Integer, Double> _iter112 : this.query_variables.entrySet()) { oprot.writeI32(_iter112.getKey()); oprot.writeDouble(_iter112.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } if (this.facetsFilter != null) { oprot.writeFieldBegin(FACETS_FILTER_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.facetsFilter.size())); for (CategoryFilter _iter113 : this.facetsFilter) { _iter113.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (this.variableRangeFilters != null) { oprot.writeFieldBegin(VARIABLE_RANGE_FILTERS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.variableRangeFilters.size())); for (RangeFilter _iter114 : this.variableRangeFilters) { _iter114.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (this.functionRangeFilters != null) { oprot.writeFieldBegin(FUNCTION_RANGE_FILTERS_FIELD_DESC); { oprot.writeListBegin(new TList(TType.STRUCT, this.functionRangeFilters.size())); for (RangeFilter _iter115 : this.functionRangeFilters) { _iter115.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("search_args("); boolean first = true; sb.append("query:"); if (this.query == null) { sb.append("null"); } else { sb.append(this.query); } first = false; if (!first) sb.append(", "); sb.append("start:"); sb.append(this.start); first = false; if (!first) sb.append(", "); sb.append("length:"); sb.append(this.length); first = false; if (!first) sb.append(", "); sb.append("scoringFunctionIndex:"); sb.append(this.scoringFunctionIndex); first = false; if (!first) sb.append(", "); sb.append("query_variables:"); if (this.query_variables == null) { sb.append("null"); } else { sb.append(this.query_variables); } first = false; if (!first) sb.append(", "); sb.append("facetsFilter:"); if (this.facetsFilter == null) { sb.append("null"); } else { sb.append(this.facetsFilter); } first = false; if (!first) sb.append(", "); sb.append("variableRangeFilters:"); if (this.variableRangeFilters == null) { sb.append("null"); } else { sb.append(this.variableRangeFilters); } first = false; if (!first) sb.append(", "); sb.append("functionRangeFilters:"); if (this.functionRangeFilters == null) { sb.append("null"); } else { sb.append(this.functionRangeFilters); } first = false; if (!first) sb.append(", "); sb.append("extra_parameters:"); if (this.extra_parameters == null) { sb.append("null"); } else { sb.append(this.extra_parameters); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class search_result implements TBase<search_result, search_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("search_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField ITE_FIELD_DESC = new TField("ite", TType.STRUCT, (short)1); private static final TField IQE_FIELD_DESC = new TField("iqe", TType.STRUCT, (short)2); private static final TField QVE_FIELD_DESC = new TField("qve", TType.STRUCT, (short)3); private ResultSet success; private IndextankException ite; private InvalidQueryException iqe; private MissingQueryVariableException qve; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { SUCCESS((short)0, "success"), ITE((short)1, "ite"), IQE((short)2, "iqe"), QVE((short)3, "qve"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // ITE return ITE; case 2: // IQE return IQE; case 3: // QVE return QVE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, ResultSet.class))); tmpMap.put(_Fields.ITE, new FieldMetaData("ite", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); tmpMap.put(_Fields.IQE, new FieldMetaData("iqe", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); tmpMap.put(_Fields.QVE, new FieldMetaData("qve", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(search_result.class, metaDataMap); } public search_result() { } public search_result( ResultSet success, IndextankException ite, InvalidQueryException iqe, MissingQueryVariableException qve) { this(); this.success = success; this.ite = ite; this.iqe = iqe; this.qve = qve; } /** * Performs a deep copy on <i>other</i>. */ public search_result(search_result other) { if (other.is_set_success()) { this.success = new ResultSet(other.success); } if (other.is_set_ite()) { this.ite = new IndextankException(other.ite); } if (other.is_set_iqe()) { this.iqe = new InvalidQueryException(other.iqe); } if (other.is_set_qve()) { this.qve = new MissingQueryVariableException(other.qve); } } public search_result deepCopy() { return new search_result(this); } @Override public void clear() { this.success = null; this.ite = null; this.iqe = null; this.qve = null; } public ResultSet get_success() { return this.success; } public search_result set_success(ResultSet success) { this.success = success; return this; } public void unset_success() { this.success = null; } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean is_set_success() { return this.success != null; } public void set_success_isSet(boolean value) { if (!value) { this.success = null; } } public IndextankException get_ite() { return this.ite; } public search_result set_ite(IndextankException ite) { this.ite = ite; return this; } public void unset_ite() { this.ite = null; } /** Returns true if field ite is set (has been asigned a value) and false otherwise */ public boolean is_set_ite() { return this.ite != null; } public void set_ite_isSet(boolean value) { if (!value) { this.ite = null; } } public InvalidQueryException get_iqe() { return this.iqe; } public search_result set_iqe(InvalidQueryException iqe) { this.iqe = iqe; return this; } public void unset_iqe() { this.iqe = null; } /** Returns true if field iqe is set (has been asigned a value) and false otherwise */ public boolean is_set_iqe() { return this.iqe != null; } public void set_iqe_isSet(boolean value) { if (!value) { this.iqe = null; } } public MissingQueryVariableException get_qve() { return this.qve; } public search_result set_qve(MissingQueryVariableException qve) { this.qve = qve; return this; } public void unset_qve() { this.qve = null; } /** Returns true if field qve is set (has been asigned a value) and false otherwise */ public boolean is_set_qve() { return this.qve != null; } public void set_qve_isSet(boolean value) { if (!value) { this.qve = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((ResultSet)value); } break; case ITE: if (value == null) { unset_ite(); } else { set_ite((IndextankException)value); } break; case IQE: if (value == null) { unset_iqe(); } else { set_iqe((InvalidQueryException)value); } break; case QVE: if (value == null) { unset_qve(); } else { set_qve((MissingQueryVariableException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return get_success(); case ITE: return get_ite(); case IQE: return get_iqe(); case QVE: return get_qve(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return is_set_success(); case ITE: return is_set_ite(); case IQE: return is_set_iqe(); case QVE: return is_set_qve(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof search_result) return this.equals((search_result)that); return false; } public boolean equals(search_result that) { if (that == null) return false; boolean this_present_success = true && this.is_set_success(); boolean that_present_success = true && that.is_set_success(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ite = true && this.is_set_ite(); boolean that_present_ite = true && that.is_set_ite(); if (this_present_ite || that_present_ite) { if (!(this_present_ite && that_present_ite)) return false; if (!this.ite.equals(that.ite)) return false; } boolean this_present_iqe = true && this.is_set_iqe(); boolean that_present_iqe = true && that.is_set_iqe(); if (this_present_iqe || that_present_iqe) { if (!(this_present_iqe && that_present_iqe)) return false; if (!this.iqe.equals(that.iqe)) return false; } boolean this_present_qve = true && this.is_set_qve(); boolean that_present_qve = true && that.is_set_qve(); if (this_present_qve || that_present_qve) { if (!(this_present_qve && that_present_qve)) return false; if (!this.qve.equals(that.qve)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(search_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; search_result typedOther = (search_result)other; lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); if (lastComparison != 0) { return lastComparison; } if (is_set_ite()) { lastComparison = TBaseHelper.compareTo(this.ite, typedOther.ite); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_iqe()).compareTo(typedOther.is_set_iqe()); if (lastComparison != 0) { return lastComparison; } if (is_set_iqe()) { lastComparison = TBaseHelper.compareTo(this.iqe, typedOther.iqe); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_qve()).compareTo(typedOther.is_set_qve()); if (lastComparison != 0) { return lastComparison; } if (is_set_qve()) { lastComparison = TBaseHelper.compareTo(this.qve, typedOther.qve); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 0: // SUCCESS if (field.type == TType.STRUCT) { this.success = new ResultSet(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case 1: // ITE if (field.type == TType.STRUCT) { this.ite = new IndextankException(); this.ite.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // IQE if (field.type == TType.STRUCT) { this.iqe = new InvalidQueryException(); this.iqe.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case 3: // QVE if (field.type == TType.STRUCT) { this.qve = new MissingQueryVariableException(); this.qve.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_success()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.is_set_ite()) { oprot.writeFieldBegin(ITE_FIELD_DESC); this.ite.write(oprot); oprot.writeFieldEnd(); } else if (this.is_set_iqe()) { oprot.writeFieldBegin(IQE_FIELD_DESC); this.iqe.write(oprot); oprot.writeFieldEnd(); } else if (this.is_set_qve()) { oprot.writeFieldBegin(QVE_FIELD_DESC); this.qve.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("search_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ite:"); if (this.ite == null) { sb.append("null"); } else { sb.append(this.ite); } first = false; if (!first) sb.append(", "); sb.append("iqe:"); if (this.iqe == null) { sb.append("null"); } else { sb.append(this.iqe); } first = false; if (!first) sb.append(", "); sb.append("qve:"); if (this.qve == null) { sb.append("null"); } else { sb.append(this.qve); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class count_args implements TBase<count_args, count_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("count_args"); private static final TField QUERY_FIELD_DESC = new TField("query", TType.STRING, (short)1); private String query; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { QUERY((short)1, "query"); 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: // QUERY return QUERY; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUERY, new FieldMetaData("query", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(count_args.class, metaDataMap); } public count_args() { } public count_args( String query) { this(); this.query = query; } /** * Performs a deep copy on <i>other</i>. */ public count_args(count_args other) { if (other.is_set_query()) { this.query = other.query; } } public count_args deepCopy() { return new count_args(this); } @Override public void clear() { this.query = null; } public String get_query() { return this.query; } public count_args set_query(String query) { this.query = query; return this; } public void unset_query() { this.query = null; } /** Returns true if field query is set (has been asigned a value) and false otherwise */ public boolean is_set_query() { return this.query != null; } public void set_query_isSet(boolean value) { if (!value) { this.query = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case QUERY: if (value == null) { unset_query(); } else { set_query((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case QUERY: return get_query(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case QUERY: return is_set_query(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof count_args) return this.equals((count_args)that); return false; } public boolean equals(count_args that) { if (that == null) return false; boolean this_present_query = true && this.is_set_query(); boolean that_present_query = true && that.is_set_query(); if (this_present_query || that_present_query) { if (!(this_present_query && that_present_query)) return false; if (!this.query.equals(that.query)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(count_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; count_args typedOther = (count_args)other; lastComparison = Boolean.valueOf(is_set_query()).compareTo(typedOther.is_set_query()); if (lastComparison != 0) { return lastComparison; } if (is_set_query()) { lastComparison = TBaseHelper.compareTo(this.query, typedOther.query); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // QUERY if (field.type == TType.STRING) { this.query = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.query != null) { oprot.writeFieldBegin(QUERY_FIELD_DESC); oprot.writeString(this.query); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("count_args("); boolean first = true; sb.append("query:"); if (this.query == null) { sb.append("null"); } else { sb.append(this.query); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class count_result implements TBase<count_result, count_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("count_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); private static final TField ITE_FIELD_DESC = new TField("ite", TType.STRUCT, (short)1); private int success; private IndextankException ite; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { SUCCESS((short)0, "success"), ITE((short)1, "ite"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // ITE return ITE; 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 BitSet __isset_bit_vector = new BitSet(1); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.ITE, new FieldMetaData("ite", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(count_result.class, metaDataMap); } public count_result() { } public count_result( int success, IndextankException ite) { this(); this.success = success; set_success_isSet(true); this.ite = ite; } /** * Performs a deep copy on <i>other</i>. */ public count_result(count_result other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.success = other.success; if (other.is_set_ite()) { this.ite = new IndextankException(other.ite); } } public count_result deepCopy() { return new count_result(this); } @Override public void clear() { set_success_isSet(false); this.success = 0; this.ite = null; } public int get_success() { return this.success; } public count_result set_success(int success) { this.success = success; set_success_isSet(true); return this; } public void unset_success() { __isset_bit_vector.clear(__SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean is_set_success() { return __isset_bit_vector.get(__SUCCESS_ISSET_ID); } public void set_success_isSet(boolean value) { __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); } public IndextankException get_ite() { return this.ite; } public count_result set_ite(IndextankException ite) { this.ite = ite; return this; } public void unset_ite() { this.ite = null; } /** Returns true if field ite is set (has been asigned a value) and false otherwise */ public boolean is_set_ite() { return this.ite != null; } public void set_ite_isSet(boolean value) { if (!value) { this.ite = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((Integer)value); } break; case ITE: if (value == null) { unset_ite(); } else { set_ite((IndextankException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return new Integer(get_success()); case ITE: return get_ite(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return is_set_success(); case ITE: return is_set_ite(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof count_result) return this.equals((count_result)that); return false; } public boolean equals(count_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; } boolean this_present_ite = true && this.is_set_ite(); boolean that_present_ite = true && that.is_set_ite(); if (this_present_ite || that_present_ite) { if (!(this_present_ite && that_present_ite)) return false; if (!this.ite.equals(that.ite)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(count_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; count_result typedOther = (count_result)other; lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); if (lastComparison != 0) { return lastComparison; } if (is_set_ite()) { lastComparison = TBaseHelper.compareTo(this.ite, typedOther.ite); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 0: // SUCCESS if (field.type == TType.I32) { this.success = iprot.readI32(); set_success_isSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 1: // ITE if (field.type == TType.STRUCT) { this.ite = new IndextankException(); this.ite.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_success()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(this.success); oprot.writeFieldEnd(); } else if (this.is_set_ite()) { oprot.writeFieldBegin(ITE_FIELD_DESC); this.ite.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("count_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ite:"); if (this.ite == null) { sb.append("null"); } else { sb.append(this.ite); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class size_args implements TBase<size_args, size_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("size_args"); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(size_args.class, metaDataMap); } public size_args() { } /** * Performs a deep copy on <i>other</i>. */ public size_args(size_args other) { } public size_args deepCopy() { return new size_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 asigned 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 size_args) return this.equals((size_args)that); return false; } public boolean equals(size_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } public int compareTo(size_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; size_args typedOther = (size_args)other; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("size_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class size_result implements TBase<size_result, size_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("size_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.I32, (short)0); private static final TField ITE_FIELD_DESC = new TField("ite", TType.STRUCT, (short)1); private int success; private IndextankException ite; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { SUCCESS((short)0, "success"), ITE((short)1, "ite"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // ITE return ITE; 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 BitSet __isset_bit_vector = new BitSet(1); public static final Map<_Fields, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.I32))); tmpMap.put(_Fields.ITE, new FieldMetaData("ite", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(size_result.class, metaDataMap); } public size_result() { } public size_result( int success, IndextankException ite) { this(); this.success = success; set_success_isSet(true); this.ite = ite; } /** * Performs a deep copy on <i>other</i>. */ public size_result(size_result other) { __isset_bit_vector.clear(); __isset_bit_vector.or(other.__isset_bit_vector); this.success = other.success; if (other.is_set_ite()) { this.ite = new IndextankException(other.ite); } } public size_result deepCopy() { return new size_result(this); } @Override public void clear() { set_success_isSet(false); this.success = 0; this.ite = null; } public int get_success() { return this.success; } public size_result set_success(int success) { this.success = success; set_success_isSet(true); return this; } public void unset_success() { __isset_bit_vector.clear(__SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean is_set_success() { return __isset_bit_vector.get(__SUCCESS_ISSET_ID); } public void set_success_isSet(boolean value) { __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); } public IndextankException get_ite() { return this.ite; } public size_result set_ite(IndextankException ite) { this.ite = ite; return this; } public void unset_ite() { this.ite = null; } /** Returns true if field ite is set (has been asigned a value) and false otherwise */ public boolean is_set_ite() { return this.ite != null; } public void set_ite_isSet(boolean value) { if (!value) { this.ite = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((Integer)value); } break; case ITE: if (value == null) { unset_ite(); } else { set_ite((IndextankException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return new Integer(get_success()); case ITE: return get_ite(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return is_set_success(); case ITE: return is_set_ite(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof size_result) return this.equals((size_result)that); return false; } public boolean equals(size_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; } boolean this_present_ite = true && this.is_set_ite(); boolean that_present_ite = true && that.is_set_ite(); if (this_present_ite || that_present_ite) { if (!(this_present_ite && that_present_ite)) return false; if (!this.ite.equals(that.ite)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(size_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; size_result typedOther = (size_result)other; lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); if (lastComparison != 0) { return lastComparison; } if (is_set_ite()) { lastComparison = TBaseHelper.compareTo(this.ite, typedOther.ite); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 0: // SUCCESS if (field.type == TType.I32) { this.success = iprot.readI32(); set_success_isSet(true); } else { TProtocolUtil.skip(iprot, field.type); } break; case 1: // ITE if (field.type == TType.STRUCT) { this.ite = new IndextankException(); this.ite.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_success()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); oprot.writeI32(this.success); oprot.writeFieldEnd(); } else if (this.is_set_ite()) { oprot.writeFieldBegin(ITE_FIELD_DESC); this.ite.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("size_result("); boolean first = true; sb.append("success:"); sb.append(this.success); first = false; if (!first) sb.append(", "); sb.append("ite:"); if (this.ite == null) { sb.append("null"); } else { sb.append(this.ite); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class stats_args implements TBase<stats_args, stats_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("stats_args"); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(stats_args.class, metaDataMap); } public stats_args() { } /** * Performs a deep copy on <i>other</i>. */ public stats_args(stats_args other) { } public stats_args deepCopy() { return new stats_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 asigned 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 stats_args) return this.equals((stats_args)that); return false; } public boolean equals(stats_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } public int compareTo(stats_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; stats_args typedOther = (stats_args)other; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("stats_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class stats_result implements TBase<stats_result, stats_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("stats_result"); private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.STRUCT, (short)0); private static final TField ITE_FIELD_DESC = new TField("ite", TType.STRUCT, (short)1); private SearcherStats success; private IndextankException ite; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { SUCCESS((short)0, "success"), ITE((short)1, "ite"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); static { for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } /** * Find the _Fields constant that matches fieldId, or null if its not found. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS return SUCCESS; case 1: // ITE return ITE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT, new StructMetaData(TType.STRUCT, SearcherStats.class))); tmpMap.put(_Fields.ITE, new FieldMetaData("ite", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(stats_result.class, metaDataMap); } public stats_result() { } public stats_result( SearcherStats success, IndextankException ite) { this(); this.success = success; this.ite = ite; } /** * Performs a deep copy on <i>other</i>. */ public stats_result(stats_result other) { if (other.is_set_success()) { this.success = new SearcherStats(other.success); } if (other.is_set_ite()) { this.ite = new IndextankException(other.ite); } } public stats_result deepCopy() { return new stats_result(this); } @Override public void clear() { this.success = null; this.ite = null; } public SearcherStats get_success() { return this.success; } public stats_result set_success(SearcherStats success) { this.success = success; return this; } public void unset_success() { this.success = null; } /** Returns true if field success is set (has been asigned a value) and false otherwise */ public boolean is_set_success() { return this.success != null; } public void set_success_isSet(boolean value) { if (!value) { this.success = null; } } public IndextankException get_ite() { return this.ite; } public stats_result set_ite(IndextankException ite) { this.ite = ite; return this; } public void unset_ite() { this.ite = null; } /** Returns true if field ite is set (has been asigned a value) and false otherwise */ public boolean is_set_ite() { return this.ite != null; } public void set_ite_isSet(boolean value) { if (!value) { this.ite = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unset_success(); } else { set_success((SearcherStats)value); } break; case ITE: if (value == null) { unset_ite(); } else { set_ite((IndextankException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return get_success(); case ITE: return get_ite(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return is_set_success(); case ITE: return is_set_ite(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof stats_result) return this.equals((stats_result)that); return false; } public boolean equals(stats_result that) { if (that == null) return false; boolean this_present_success = true && this.is_set_success(); boolean that_present_success = true && that.is_set_success(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_ite = true && this.is_set_ite(); boolean that_present_ite = true && that.is_set_ite(); if (this_present_ite || that_present_ite) { if (!(this_present_ite && that_present_ite)) return false; if (!this.ite.equals(that.ite)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(stats_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; stats_result typedOther = (stats_result)other; lastComparison = Boolean.valueOf(is_set_success()).compareTo(typedOther.is_set_success()); if (lastComparison != 0) { return lastComparison; } if (is_set_success()) { lastComparison = TBaseHelper.compareTo(this.success, typedOther.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(is_set_ite()).compareTo(typedOther.is_set_ite()); if (lastComparison != 0) { return lastComparison; } if (is_set_ite()) { lastComparison = TBaseHelper.compareTo(this.ite, typedOther.ite); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 0: // SUCCESS if (field.type == TType.STRUCT) { this.success = new SearcherStats(); this.success.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; case 1: // ITE if (field.type == TType.STRUCT) { this.ite = new IndextankException(); this.ite.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_success()) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); this.success.write(oprot); oprot.writeFieldEnd(); } else if (this.is_set_ite()) { oprot.writeFieldBegin(ITE_FIELD_DESC); this.ite.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("stats_result("); boolean first = true; sb.append("success:"); if (this.success == null) { sb.append("null"); } else { sb.append(this.success); } first = false; if (!first) sb.append(", "); sb.append("ite:"); if (this.ite == null) { sb.append("null"); } else { sb.append(this.ite); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } }