/** * Autogenerated by Thrift Compiler (0.9.2) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package com.xiaomi.infra.galaxy.metrics.thrift; import libthrift091.scheme.IScheme; import libthrift091.scheme.SchemeFactory; import libthrift091.scheme.StandardScheme; import libthrift091.scheme.TupleScheme; import libthrift091.protocol.TTupleProtocol; import libthrift091.protocol.TProtocolException; import libthrift091.EncodingUtils; import libthrift091.TException; import libthrift091.async.AsyncMethodCallback; import libthrift091.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.util.HashMap; import java.util.EnumMap; import java.util.Set; import java.util.HashSet; import java.util.EnumSet; import java.util.Collections; import java.util.BitSet; import java.nio.ByteBuffer; import java.util.Arrays; import javax.annotation.Generated; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-12-30") public class JudgeService { /** * 报警类接口 */ public interface Iface extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService.Iface { public void addAlertRule(AlertRule alertRule) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException; public void removeAlertRule(AlertRuleKey ruleKey) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException; public List<AlertRule> listAlertRules(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException; } public interface AsyncIface extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService .AsyncIface { public void addAlertRule(AlertRule alertRule, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void removeAlertRule(AlertRuleKey ruleKey, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; public void listAlertRules(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException; } public static class Client extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService.Client implements Iface { public static class Factory implements libthrift091.TServiceClientFactory<Client> { public Factory() {} public Client getClient(libthrift091.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(libthrift091.protocol.TProtocol prot) { super(prot, prot); } public Client(libthrift091.protocol.TProtocol iprot, libthrift091.protocol.TProtocol oprot) { super(iprot, oprot); } public void addAlertRule(AlertRule alertRule) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { send_addAlertRule(alertRule); recv_addAlertRule(); } public void send_addAlertRule(AlertRule alertRule) throws libthrift091.TException { addAlertRule_args args = new addAlertRule_args(); args.setAlertRule(alertRule); sendBase("addAlertRule", args); } public void recv_addAlertRule() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { addAlertRule_result result = new addAlertRule_result(); receiveBase(result, "addAlertRule"); if (result.se != null) { throw result.se; } return; } public void removeAlertRule(AlertRuleKey ruleKey) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { send_removeAlertRule(ruleKey); recv_removeAlertRule(); } public void send_removeAlertRule(AlertRuleKey ruleKey) throws libthrift091.TException { removeAlertRule_args args = new removeAlertRule_args(); args.setRuleKey(ruleKey); sendBase("removeAlertRule", args); } public void recv_removeAlertRule() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { removeAlertRule_result result = new removeAlertRule_result(); receiveBase(result, "removeAlertRule"); if (result.se != null) { throw result.se; } return; } public List<AlertRule> listAlertRules(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { send_listAlertRules(metricKey); return recv_listAlertRules(); } public void send_listAlertRules(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) throws libthrift091.TException { listAlertRules_args args = new listAlertRules_args(); args.setMetricKey(metricKey); sendBase("listAlertRules", args); } public List<AlertRule> recv_listAlertRules() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { listAlertRules_result result = new listAlertRules_result(); receiveBase(result, "listAlertRules"); if (result.isSetSuccess()) { return result.success; } if (result.se != null) { throw result.se; } throw new libthrift091.TApplicationException(libthrift091.TApplicationException.MISSING_RESULT, "listAlertRules failed: unknown result"); } } public static class AsyncClient extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService.AsyncClient implements AsyncIface { public static class Factory implements libthrift091.async.TAsyncClientFactory<AsyncClient> { private libthrift091.async.TAsyncClientManager clientManager; private libthrift091.protocol.TProtocolFactory protocolFactory; public Factory(libthrift091.async.TAsyncClientManager clientManager, libthrift091.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(libthrift091.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.async.TAsyncClientManager clientManager, libthrift091.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void addAlertRule(AlertRule alertRule, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); addAlertRule_call method_call = new addAlertRule_call(alertRule, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class addAlertRule_call extends libthrift091.async.TAsyncMethodCall { private AlertRule alertRule; public addAlertRule_call(AlertRule alertRule, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.alertRule = alertRule; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("addAlertRule", libthrift091.protocol.TMessageType.CALL, 0)); addAlertRule_args args = new addAlertRule_args(); args.setAlertRule(alertRule); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_addAlertRule(); } } public void removeAlertRule(AlertRuleKey ruleKey, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); removeAlertRule_call method_call = new removeAlertRule_call(ruleKey, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class removeAlertRule_call extends libthrift091.async.TAsyncMethodCall { private AlertRuleKey ruleKey; public removeAlertRule_call(AlertRuleKey ruleKey, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.ruleKey = ruleKey; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("removeAlertRule", libthrift091.protocol.TMessageType.CALL, 0)); removeAlertRule_args args = new removeAlertRule_args(); args.setRuleKey(ruleKey); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_removeAlertRule(); } } public void listAlertRules(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey, libthrift091.async.AsyncMethodCallback resultHandler) throws libthrift091.TException { checkReady(); listAlertRules_call method_call = new listAlertRules_call(metricKey, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class listAlertRules_call extends libthrift091.async.TAsyncMethodCall { private com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey; public listAlertRules_call(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey, libthrift091.async.AsyncMethodCallback resultHandler, libthrift091.async.TAsyncClient client, libthrift091.protocol.TProtocolFactory protocolFactory, libthrift091.transport.TNonblockingTransport transport) throws libthrift091.TException { super(client, protocolFactory, transport, resultHandler, false); this.metricKey = metricKey; } public void write_args(libthrift091.protocol.TProtocol prot) throws libthrift091.TException { prot.writeMessageBegin(new libthrift091.protocol.TMessage("listAlertRules", libthrift091.protocol.TMessageType.CALL, 0)); listAlertRules_args args = new listAlertRules_args(); args.setMetricKey(metricKey); args.write(prot); prot.writeMessageEnd(); } public List<AlertRule> getResult() throws com.xiaomi.infra.galaxy.metrics.thrift.ServiceException, libthrift091.TException { if (getState() != libthrift091.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } libthrift091.transport.TMemoryInputTransport memoryTransport = new libthrift091.transport.TMemoryInputTransport(getFrameBuffer().array()); libthrift091.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_listAlertRules(); } } } public static class Processor<I extends Iface> extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService.Processor<I> implements libthrift091.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>>())); } protected Processor(I iface, Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> getProcessMap(Map<String, libthrift091.ProcessFunction<I, ? extends libthrift091.TBase>> processMap) { processMap.put("addAlertRule", new addAlertRule()); processMap.put("removeAlertRule", new removeAlertRule()); processMap.put("listAlertRules", new listAlertRules()); return processMap; } public static class addAlertRule<I extends Iface> extends libthrift091.ProcessFunction<I, addAlertRule_args> { public addAlertRule() { super("addAlertRule"); } public addAlertRule_args getEmptyArgsInstance() { return new addAlertRule_args(); } protected boolean isOneway() { return false; } public addAlertRule_result getResult(I iface, addAlertRule_args args) throws libthrift091.TException { addAlertRule_result result = new addAlertRule_result(); try { iface.addAlertRule(args.alertRule); } catch (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { result.se = se; } return result; } } public static class removeAlertRule<I extends Iface> extends libthrift091.ProcessFunction<I, removeAlertRule_args> { public removeAlertRule() { super("removeAlertRule"); } public removeAlertRule_args getEmptyArgsInstance() { return new removeAlertRule_args(); } protected boolean isOneway() { return false; } public removeAlertRule_result getResult(I iface, removeAlertRule_args args) throws libthrift091.TException { removeAlertRule_result result = new removeAlertRule_result(); try { iface.removeAlertRule(args.ruleKey); } catch (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { result.se = se; } return result; } } public static class listAlertRules<I extends Iface> extends libthrift091.ProcessFunction<I, listAlertRules_args> { public listAlertRules() { super("listAlertRules"); } public listAlertRules_args getEmptyArgsInstance() { return new listAlertRules_args(); } protected boolean isOneway() { return false; } public listAlertRules_result getResult(I iface, listAlertRules_args args) throws libthrift091.TException { listAlertRules_result result = new listAlertRules_result(); try { result.success = iface.listAlertRules(args.metricKey); } catch (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { result.se = se; } return result; } } } public static class AsyncProcessor<I extends AsyncIface> extends com.xiaomi.infra.galaxy.metrics.thrift.BaseService.AsyncProcessor<I> { private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { super(iface, getProcessMap(new HashMap<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>>())); } protected AsyncProcessor(I iface, Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends AsyncIface> Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase,?>> getProcessMap(Map<String, libthrift091.AsyncProcessFunction<I, ? extends libthrift091.TBase, ?>> processMap) { processMap.put("addAlertRule", new addAlertRule()); processMap.put("removeAlertRule", new removeAlertRule()); processMap.put("listAlertRules", new listAlertRules()); return processMap; } public static class addAlertRule<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, addAlertRule_args, Void> { public addAlertRule() { super("addAlertRule"); } public addAlertRule_args getEmptyArgsInstance() { return new addAlertRule_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { addAlertRule_result result = new addAlertRule_result(); try { fcall.sendResponse(fb,result, libthrift091.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; addAlertRule_result result = new addAlertRule_result(); if (e instanceof com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, addAlertRule_args args, libthrift091.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.addAlertRule(args.alertRule,resultHandler); } } public static class removeAlertRule<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, removeAlertRule_args, Void> { public removeAlertRule() { super("removeAlertRule"); } public removeAlertRule_args getEmptyArgsInstance() { return new removeAlertRule_args(); } public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<Void>() { public void onComplete(Void o) { removeAlertRule_result result = new removeAlertRule_result(); try { fcall.sendResponse(fb,result, libthrift091.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; removeAlertRule_result result = new removeAlertRule_result(); if (e instanceof com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, removeAlertRule_args args, libthrift091.async.AsyncMethodCallback<Void> resultHandler) throws TException { iface.removeAlertRule(args.ruleKey,resultHandler); } } public static class listAlertRules<I extends AsyncIface> extends libthrift091.AsyncProcessFunction<I, listAlertRules_args, List<AlertRule>> { public listAlertRules() { super("listAlertRules"); } public listAlertRules_args getEmptyArgsInstance() { return new listAlertRules_args(); } public AsyncMethodCallback<List<AlertRule>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final libthrift091.AsyncProcessFunction fcall = this; return new AsyncMethodCallback<List<AlertRule>>() { public void onComplete(List<AlertRule> o) { listAlertRules_result result = new listAlertRules_result(); result.success = o; try { fcall.sendResponse(fb,result, libthrift091.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) { byte msgType = libthrift091.protocol.TMessageType.REPLY; libthrift091.TBase msg; listAlertRules_result result = new listAlertRules_result(); if (e instanceof com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) { result.se = (com.xiaomi.infra.galaxy.metrics.thrift.ServiceException) e; result.setSeIsSet(true); msg = result; } else { msgType = libthrift091.protocol.TMessageType.EXCEPTION; msg = (libthrift091.TBase)new libthrift091.TApplicationException(libthrift091.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } }; } protected boolean isOneway() { return false; } public void start(I iface, listAlertRules_args args, libthrift091.async.AsyncMethodCallback<List<AlertRule>> resultHandler) throws TException { iface.listAlertRules(args.metricKey,resultHandler); } } } public static class addAlertRule_args implements libthrift091.TBase<addAlertRule_args, addAlertRule_args._Fields>, java.io.Serializable, Cloneable, Comparable<addAlertRule_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("addAlertRule_args"); private static final libthrift091.protocol.TField ALERT_RULE_FIELD_DESC = new libthrift091.protocol.TField("alertRule", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addAlertRule_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new addAlertRule_argsTupleSchemeFactory()); } public AlertRule alertRule; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { ALERT_RULE((short)1, "alertRule"); 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: // ALERT_RULE return ALERT_RULE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.ALERT_RULE, new libthrift091.meta_data.FieldMetaData("alertRule", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, AlertRule.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(addAlertRule_args.class, metaDataMap); } public addAlertRule_args() { } public addAlertRule_args( AlertRule alertRule) { this(); this.alertRule = alertRule; } /** * Performs a deep copy on <i>other</i>. */ public addAlertRule_args(addAlertRule_args other) { if (other.isSetAlertRule()) { this.alertRule = new AlertRule(other.alertRule); } } public addAlertRule_args deepCopy() { return new addAlertRule_args(this); } @Override public void clear() { this.alertRule = null; } public AlertRule getAlertRule() { return this.alertRule; } public addAlertRule_args setAlertRule(AlertRule alertRule) { this.alertRule = alertRule; return this; } public void unsetAlertRule() { this.alertRule = null; } /** Returns true if field alertRule is set (has been assigned a value) and false otherwise */ public boolean isSetAlertRule() { return this.alertRule != null; } public void setAlertRuleIsSet(boolean value) { if (!value) { this.alertRule = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case ALERT_RULE: if (value == null) { unsetAlertRule(); } else { setAlertRule((AlertRule)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case ALERT_RULE: return getAlertRule(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case ALERT_RULE: return isSetAlertRule(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addAlertRule_args) return this.equals((addAlertRule_args)that); return false; } public boolean equals(addAlertRule_args that) { if (that == null) return false; boolean this_present_alertRule = true && this.isSetAlertRule(); boolean that_present_alertRule = true && that.isSetAlertRule(); if (this_present_alertRule || that_present_alertRule) { if (!(this_present_alertRule && that_present_alertRule)) return false; if (!this.alertRule.equals(that.alertRule)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_alertRule = true && (isSetAlertRule()); list.add(present_alertRule); if (present_alertRule) list.add(alertRule); return list.hashCode(); } @Override public int compareTo(addAlertRule_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetAlertRule()).compareTo(other.isSetAlertRule()); if (lastComparison != 0) { return lastComparison; } if (isSetAlertRule()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.alertRule, other.alertRule); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addAlertRule_args("); boolean first = true; sb.append("alertRule:"); if (this.alertRule == null) { sb.append("null"); } else { sb.append(this.alertRule); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (alertRule != null) { alertRule.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class addAlertRule_argsStandardSchemeFactory implements SchemeFactory { public addAlertRule_argsStandardScheme getScheme() { return new addAlertRule_argsStandardScheme(); } } private static class addAlertRule_argsStandardScheme extends StandardScheme<addAlertRule_args> { public void read(libthrift091.protocol.TProtocol iprot, addAlertRule_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // ALERT_RULE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.alertRule = new AlertRule(); struct.alertRule.read(iprot); struct.setAlertRuleIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, addAlertRule_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.alertRule != null) { oprot.writeFieldBegin(ALERT_RULE_FIELD_DESC); struct.alertRule.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addAlertRule_argsTupleSchemeFactory implements SchemeFactory { public addAlertRule_argsTupleScheme getScheme() { return new addAlertRule_argsTupleScheme(); } } private static class addAlertRule_argsTupleScheme extends TupleScheme<addAlertRule_args> { @Override public void write(libthrift091.protocol.TProtocol prot, addAlertRule_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetAlertRule()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetAlertRule()) { struct.alertRule.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, addAlertRule_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.alertRule = new AlertRule(); struct.alertRule.read(iprot); struct.setAlertRuleIsSet(true); } } } } public static class addAlertRule_result implements libthrift091.TBase<addAlertRule_result, addAlertRule_result._Fields>, java.io.Serializable, Cloneable, Comparable<addAlertRule_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("addAlertRule_result"); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new addAlertRule_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new addAlertRule_resultTupleSchemeFactory()); } public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SE((short)1, "se"); 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: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(addAlertRule_result.class, metaDataMap); } public addAlertRule_result() { } public addAlertRule_result( com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this(); this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public addAlertRule_result(addAlertRule_result other) { if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(other.se); } } public addAlertRule_result deepCopy() { return new addAlertRule_result(this); } @Override public void clear() { this.se = null; } public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException getSe() { return this.se; } public addAlertRule_result setSe(com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.metrics.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof addAlertRule_result) return this.equals((addAlertRule_result)that); return false; } public boolean equals(addAlertRule_result that) { if (that == null) return false; boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(addAlertRule_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("addAlertRule_result("); boolean first = true; sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class addAlertRule_resultStandardSchemeFactory implements SchemeFactory { public addAlertRule_resultStandardScheme getScheme() { return new addAlertRule_resultStandardScheme(); } } private static class addAlertRule_resultStandardScheme extends StandardScheme<addAlertRule_result> { public void read(libthrift091.protocol.TProtocol iprot, addAlertRule_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, addAlertRule_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class addAlertRule_resultTupleSchemeFactory implements SchemeFactory { public addAlertRule_resultTupleScheme getScheme() { return new addAlertRule_resultTupleScheme(); } } private static class addAlertRule_resultTupleScheme extends TupleScheme<addAlertRule_result> { @Override public void write(libthrift091.protocol.TProtocol prot, addAlertRule_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSe()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, addAlertRule_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class removeAlertRule_args implements libthrift091.TBase<removeAlertRule_args, removeAlertRule_args._Fields>, java.io.Serializable, Cloneable, Comparable<removeAlertRule_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("removeAlertRule_args"); private static final libthrift091.protocol.TField RULE_KEY_FIELD_DESC = new libthrift091.protocol.TField("ruleKey", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new removeAlertRule_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new removeAlertRule_argsTupleSchemeFactory()); } public AlertRuleKey ruleKey; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { RULE_KEY((short)1, "ruleKey"); 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: // RULE_KEY return RULE_KEY; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.RULE_KEY, new libthrift091.meta_data.FieldMetaData("ruleKey", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, AlertRuleKey.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(removeAlertRule_args.class, metaDataMap); } public removeAlertRule_args() { } public removeAlertRule_args( AlertRuleKey ruleKey) { this(); this.ruleKey = ruleKey; } /** * Performs a deep copy on <i>other</i>. */ public removeAlertRule_args(removeAlertRule_args other) { if (other.isSetRuleKey()) { this.ruleKey = new AlertRuleKey(other.ruleKey); } } public removeAlertRule_args deepCopy() { return new removeAlertRule_args(this); } @Override public void clear() { this.ruleKey = null; } public AlertRuleKey getRuleKey() { return this.ruleKey; } public removeAlertRule_args setRuleKey(AlertRuleKey ruleKey) { this.ruleKey = ruleKey; return this; } public void unsetRuleKey() { this.ruleKey = null; } /** Returns true if field ruleKey is set (has been assigned a value) and false otherwise */ public boolean isSetRuleKey() { return this.ruleKey != null; } public void setRuleKeyIsSet(boolean value) { if (!value) { this.ruleKey = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case RULE_KEY: if (value == null) { unsetRuleKey(); } else { setRuleKey((AlertRuleKey)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case RULE_KEY: return getRuleKey(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case RULE_KEY: return isSetRuleKey(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof removeAlertRule_args) return this.equals((removeAlertRule_args)that); return false; } public boolean equals(removeAlertRule_args that) { if (that == null) return false; boolean this_present_ruleKey = true && this.isSetRuleKey(); boolean that_present_ruleKey = true && that.isSetRuleKey(); if (this_present_ruleKey || that_present_ruleKey) { if (!(this_present_ruleKey && that_present_ruleKey)) return false; if (!this.ruleKey.equals(that.ruleKey)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_ruleKey = true && (isSetRuleKey()); list.add(present_ruleKey); if (present_ruleKey) list.add(ruleKey); return list.hashCode(); } @Override public int compareTo(removeAlertRule_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetRuleKey()).compareTo(other.isSetRuleKey()); if (lastComparison != 0) { return lastComparison; } if (isSetRuleKey()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.ruleKey, other.ruleKey); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("removeAlertRule_args("); boolean first = true; sb.append("ruleKey:"); if (this.ruleKey == null) { sb.append("null"); } else { sb.append(this.ruleKey); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (ruleKey != null) { ruleKey.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class removeAlertRule_argsStandardSchemeFactory implements SchemeFactory { public removeAlertRule_argsStandardScheme getScheme() { return new removeAlertRule_argsStandardScheme(); } } private static class removeAlertRule_argsStandardScheme extends StandardScheme<removeAlertRule_args> { public void read(libthrift091.protocol.TProtocol iprot, removeAlertRule_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // RULE_KEY if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.ruleKey = new AlertRuleKey(); struct.ruleKey.read(iprot); struct.setRuleKeyIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, removeAlertRule_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.ruleKey != null) { oprot.writeFieldBegin(RULE_KEY_FIELD_DESC); struct.ruleKey.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class removeAlertRule_argsTupleSchemeFactory implements SchemeFactory { public removeAlertRule_argsTupleScheme getScheme() { return new removeAlertRule_argsTupleScheme(); } } private static class removeAlertRule_argsTupleScheme extends TupleScheme<removeAlertRule_args> { @Override public void write(libthrift091.protocol.TProtocol prot, removeAlertRule_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRuleKey()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetRuleKey()) { struct.ruleKey.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, removeAlertRule_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.ruleKey = new AlertRuleKey(); struct.ruleKey.read(iprot); struct.setRuleKeyIsSet(true); } } } } public static class removeAlertRule_result implements libthrift091.TBase<removeAlertRule_result, removeAlertRule_result._Fields>, java.io.Serializable, Cloneable, Comparable<removeAlertRule_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("removeAlertRule_result"); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new removeAlertRule_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new removeAlertRule_resultTupleSchemeFactory()); } public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SE((short)1, "se"); 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: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(removeAlertRule_result.class, metaDataMap); } public removeAlertRule_result() { } public removeAlertRule_result( com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this(); this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public removeAlertRule_result(removeAlertRule_result other) { if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(other.se); } } public removeAlertRule_result deepCopy() { return new removeAlertRule_result(this); } @Override public void clear() { this.se = null; } public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException getSe() { return this.se; } public removeAlertRule_result setSe(com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.metrics.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof removeAlertRule_result) return this.equals((removeAlertRule_result)that); return false; } public boolean equals(removeAlertRule_result that) { if (that == null) return false; boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(removeAlertRule_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("removeAlertRule_result("); boolean first = true; sb.append("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class removeAlertRule_resultStandardSchemeFactory implements SchemeFactory { public removeAlertRule_resultStandardScheme getScheme() { return new removeAlertRule_resultStandardScheme(); } } private static class removeAlertRule_resultStandardScheme extends StandardScheme<removeAlertRule_result> { public void read(libthrift091.protocol.TProtocol iprot, removeAlertRule_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, removeAlertRule_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class removeAlertRule_resultTupleSchemeFactory implements SchemeFactory { public removeAlertRule_resultTupleScheme getScheme() { return new removeAlertRule_resultTupleScheme(); } } private static class removeAlertRule_resultTupleScheme extends TupleScheme<removeAlertRule_result> { @Override public void write(libthrift091.protocol.TProtocol prot, removeAlertRule_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSe()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, removeAlertRule_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } public static class listAlertRules_args implements libthrift091.TBase<listAlertRules_args, listAlertRules_args._Fields>, java.io.Serializable, Cloneable, Comparable<listAlertRules_args> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("listAlertRules_args"); private static final libthrift091.protocol.TField METRIC_KEY_FIELD_DESC = new libthrift091.protocol.TField("metricKey", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new listAlertRules_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new listAlertRules_argsTupleSchemeFactory()); } public com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { METRIC_KEY((short)1, "metricKey"); 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: // METRIC_KEY return METRIC_KEY; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.METRIC_KEY, new libthrift091.meta_data.FieldMetaData("metricKey", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, com.xiaomi.infra.galaxy.metrics.thrift.MetricKey.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(listAlertRules_args.class, metaDataMap); } public listAlertRules_args() { } public listAlertRules_args( com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) { this(); this.metricKey = metricKey; } /** * Performs a deep copy on <i>other</i>. */ public listAlertRules_args(listAlertRules_args other) { if (other.isSetMetricKey()) { this.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey(other.metricKey); } } public listAlertRules_args deepCopy() { return new listAlertRules_args(this); } @Override public void clear() { this.metricKey = null; } public com.xiaomi.infra.galaxy.metrics.thrift.MetricKey getMetricKey() { return this.metricKey; } public listAlertRules_args setMetricKey(com.xiaomi.infra.galaxy.metrics.thrift.MetricKey metricKey) { this.metricKey = metricKey; return this; } public void unsetMetricKey() { this.metricKey = null; } /** Returns true if field metricKey is set (has been assigned a value) and false otherwise */ public boolean isSetMetricKey() { return this.metricKey != null; } public void setMetricKeyIsSet(boolean value) { if (!value) { this.metricKey = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case METRIC_KEY: if (value == null) { unsetMetricKey(); } else { setMetricKey((com.xiaomi.infra.galaxy.metrics.thrift.MetricKey)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case METRIC_KEY: return getMetricKey(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case METRIC_KEY: return isSetMetricKey(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof listAlertRules_args) return this.equals((listAlertRules_args)that); return false; } public boolean equals(listAlertRules_args that) { if (that == null) return false; boolean this_present_metricKey = true && this.isSetMetricKey(); boolean that_present_metricKey = true && that.isSetMetricKey(); if (this_present_metricKey || that_present_metricKey) { if (!(this_present_metricKey && that_present_metricKey)) return false; if (!this.metricKey.equals(that.metricKey)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_metricKey = true && (isSetMetricKey()); list.add(present_metricKey); if (present_metricKey) list.add(metricKey); return list.hashCode(); } @Override public int compareTo(listAlertRules_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetMetricKey()).compareTo(other.isSetMetricKey()); if (lastComparison != 0) { return lastComparison; } if (isSetMetricKey()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.metricKey, other.metricKey); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("listAlertRules_args("); boolean first = true; sb.append("metricKey:"); if (this.metricKey == null) { sb.append("null"); } else { sb.append(this.metricKey); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity if (metricKey != null) { metricKey.validate(); } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class listAlertRules_argsStandardSchemeFactory implements SchemeFactory { public listAlertRules_argsStandardScheme getScheme() { return new listAlertRules_argsStandardScheme(); } } private static class listAlertRules_argsStandardScheme extends StandardScheme<listAlertRules_args> { public void read(libthrift091.protocol.TProtocol iprot, listAlertRules_args struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // METRIC_KEY if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey(); struct.metricKey.read(iprot); struct.setMetricKeyIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, listAlertRules_args struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.metricKey != null) { oprot.writeFieldBegin(METRIC_KEY_FIELD_DESC); struct.metricKey.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class listAlertRules_argsTupleSchemeFactory implements SchemeFactory { public listAlertRules_argsTupleScheme getScheme() { return new listAlertRules_argsTupleScheme(); } } private static class listAlertRules_argsTupleScheme extends TupleScheme<listAlertRules_args> { @Override public void write(libthrift091.protocol.TProtocol prot, listAlertRules_args struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetMetricKey()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetMetricKey()) { struct.metricKey.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, listAlertRules_args struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.metricKey = new com.xiaomi.infra.galaxy.metrics.thrift.MetricKey(); struct.metricKey.read(iprot); struct.setMetricKeyIsSet(true); } } } } public static class listAlertRules_result implements libthrift091.TBase<listAlertRules_result, listAlertRules_result._Fields>, java.io.Serializable, Cloneable, Comparable<listAlertRules_result> { private static final libthrift091.protocol.TStruct STRUCT_DESC = new libthrift091.protocol.TStruct("listAlertRules_result"); private static final libthrift091.protocol.TField SUCCESS_FIELD_DESC = new libthrift091.protocol.TField("success", libthrift091.protocol.TType.LIST, (short)0); private static final libthrift091.protocol.TField SE_FIELD_DESC = new libthrift091.protocol.TField("se", libthrift091.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new listAlertRules_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new listAlertRules_resultTupleSchemeFactory()); } public List<AlertRule> success; // required public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements libthrift091.TFieldIdEnum { SUCCESS((short)0, "success"), SE((short)1, "se"); 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: // SE return SE; 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, libthrift091.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, libthrift091.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, libthrift091.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SUCCESS, new libthrift091.meta_data.FieldMetaData("success", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.ListMetaData(libthrift091.protocol.TType.LIST, new libthrift091.meta_data.StructMetaData(libthrift091.protocol.TType.STRUCT, AlertRule.class)))); tmpMap.put(_Fields.SE, new libthrift091.meta_data.FieldMetaData("se", libthrift091.TFieldRequirementType.DEFAULT, new libthrift091.meta_data.FieldValueMetaData(libthrift091.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); libthrift091.meta_data.FieldMetaData.addStructMetaDataMap(listAlertRules_result.class, metaDataMap); } public listAlertRules_result() { } public listAlertRules_result( List<AlertRule> success, com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this(); this.success = success; this.se = se; } /** * Performs a deep copy on <i>other</i>. */ public listAlertRules_result(listAlertRules_result other) { if (other.isSetSuccess()) { List<AlertRule> __this__success = new ArrayList<AlertRule>(other.success.size()); for (AlertRule other_element : other.success) { __this__success.add(new AlertRule(other_element)); } this.success = __this__success; } if (other.isSetSe()) { this.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(other.se); } } public listAlertRules_result deepCopy() { return new listAlertRules_result(this); } @Override public void clear() { this.success = null; this.se = null; } public int getSuccessSize() { return (this.success == null) ? 0 : this.success.size(); } public java.util.Iterator<AlertRule> getSuccessIterator() { return (this.success == null) ? null : this.success.iterator(); } public void addToSuccess(AlertRule elem) { if (this.success == null) { this.success = new ArrayList<AlertRule>(); } this.success.add(elem); } public List<AlertRule> getSuccess() { return this.success; } public listAlertRules_result setSuccess(List<AlertRule> success) { this.success = success; return this; } public void unsetSuccess() { this.success = null; } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { return this.success != null; } public void setSuccessIsSet(boolean value) { if (!value) { this.success = null; } } public com.xiaomi.infra.galaxy.metrics.thrift.ServiceException getSe() { return this.se; } public listAlertRules_result setSe(com.xiaomi.infra.galaxy.metrics.thrift.ServiceException se) { this.se = se; return this; } public void unsetSe() { this.se = null; } /** Returns true if field se is set (has been assigned a value) and false otherwise */ public boolean isSetSe() { return this.se != null; } public void setSeIsSet(boolean value) { if (!value) { this.se = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { unsetSuccess(); } else { setSuccess((List<AlertRule>)value); } break; case SE: if (value == null) { unsetSe(); } else { setSe((com.xiaomi.infra.galaxy.metrics.thrift.ServiceException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); case SE: return getSe(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); case SE: return isSetSe(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof listAlertRules_result) return this.equals((listAlertRules_result)that); return false; } public boolean equals(listAlertRules_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } boolean this_present_se = true && this.isSetSe(); boolean that_present_se = true && that.isSetSe(); if (this_present_se || that_present_se) { if (!(this_present_se && that_present_se)) return false; if (!this.se.equals(that.se)) return false; } return true; } @Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_success = true && (isSetSuccess()); list.add(present_success); if (present_success) list.add(success); boolean present_se = true && (isSetSe()); list.add(present_se); if (present_se) list.add(se); return list.hashCode(); } @Override public int compareTo(listAlertRules_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.success, other.success); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSe()).compareTo(other.isSetSe()); if (lastComparison != 0) { return lastComparison; } if (isSetSe()) { lastComparison = libthrift091.TBaseHelper.compareTo(this.se, other.se); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(libthrift091.protocol.TProtocol iprot) throws libthrift091.TException { schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(libthrift091.protocol.TProtocol oprot) throws libthrift091.TException { schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { StringBuilder sb = new StringBuilder("listAlertRules_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("se:"); if (this.se == null) { sb.append("null"); } else { sb.append(this.se); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws libthrift091.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(out))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new libthrift091.protocol.TCompactProtocol(new libthrift091.transport.TIOStreamTransport(in))); } catch (libthrift091.TException te) { throw new java.io.IOException(te); } } private static class listAlertRules_resultStandardSchemeFactory implements SchemeFactory { public listAlertRules_resultStandardScheme getScheme() { return new listAlertRules_resultStandardScheme(); } } private static class listAlertRules_resultStandardScheme extends StandardScheme<listAlertRules_result> { public void read(libthrift091.protocol.TProtocol iprot, listAlertRules_result struct) throws libthrift091.TException { libthrift091.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == libthrift091.protocol.TType.STOP) { break; } switch (schemeField.id) { case 0: // SUCCESS if (schemeField.type == libthrift091.protocol.TType.LIST) { { libthrift091.protocol.TList _list16 = iprot.readListBegin(); struct.success = new ArrayList<AlertRule>(_list16.size); AlertRule _elem17; for (int _i18 = 0; _i18 < _list16.size; ++_i18) { _elem17 = new AlertRule(); _elem17.read(iprot); struct.success.add(_elem17); } iprot.readListEnd(); } struct.setSuccessIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 1: // SE if (schemeField.type == libthrift091.protocol.TType.STRUCT) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } else { libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: libthrift091.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method struct.validate(); } public void write(libthrift091.protocol.TProtocol oprot, listAlertRules_result struct) throws libthrift091.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.success != null) { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new libthrift091.protocol.TList(libthrift091.protocol.TType.STRUCT, struct.success.size())); for (AlertRule _iter19 : struct.success) { _iter19.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.se != null) { oprot.writeFieldBegin(SE_FIELD_DESC); struct.se.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class listAlertRules_resultTupleSchemeFactory implements SchemeFactory { public listAlertRules_resultTupleScheme getScheme() { return new listAlertRules_resultTupleScheme(); } } private static class listAlertRules_resultTupleScheme extends TupleScheme<listAlertRules_result> { @Override public void write(libthrift091.protocol.TProtocol prot, listAlertRules_result struct) throws libthrift091.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } if (struct.isSetSe()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); for (AlertRule _iter20 : struct.success) { _iter20.write(oprot); } } } if (struct.isSetSe()) { struct.se.write(oprot); } } @Override public void read(libthrift091.protocol.TProtocol prot, listAlertRules_result struct) throws libthrift091.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { libthrift091.protocol.TList _list21 = new libthrift091.protocol.TList(libthrift091.protocol.TType.STRUCT, iprot.readI32()); struct.success = new ArrayList<AlertRule>(_list21.size); AlertRule _elem22; for (int _i23 = 0; _i23 < _list21.size; ++_i23) { _elem22 = new AlertRule(); _elem22.read(iprot); struct.success.add(_elem22); } } struct.setSuccessIsSet(true); } if (incoming.get(1)) { struct.se = new com.xiaomi.infra.galaxy.metrics.thrift.ServiceException(); struct.se.read(iprot); struct.setSeIsSet(true); } } } } }