PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/src-gen/com/facebook/buck/distributed/thrift/BuildStatusResponse.java

https://gitlab.com/smartether/buck
Java | 401 lines | 312 code | 63 blank | 26 comment | 53 complexity | b390ea185877385f9320b2dec1b33a94 MD5 | raw file
  1. /**
  2. * Autogenerated by Thrift Compiler (0.9.3)
  3. *
  4. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. * @generated
  6. */
  7. package com.facebook.buck.distributed.thrift;
  8. import org.apache.thrift.scheme.IScheme;
  9. import org.apache.thrift.scheme.SchemeFactory;
  10. import org.apache.thrift.scheme.StandardScheme;
  11. import org.apache.thrift.scheme.TupleScheme;
  12. import org.apache.thrift.protocol.TTupleProtocol;
  13. import org.apache.thrift.protocol.TProtocolException;
  14. import org.apache.thrift.EncodingUtils;
  15. import org.apache.thrift.TException;
  16. import org.apache.thrift.async.AsyncMethodCallback;
  17. import org.apache.thrift.server.AbstractNonblockingServer.*;
  18. import java.util.List;
  19. import java.util.ArrayList;
  20. import java.util.Map;
  21. import java.util.HashMap;
  22. import java.util.EnumMap;
  23. import java.util.Set;
  24. import java.util.HashSet;
  25. import java.util.EnumSet;
  26. import java.util.Collections;
  27. import java.util.BitSet;
  28. import java.nio.ByteBuffer;
  29. import java.util.Arrays;
  30. import javax.annotation.Generated;
  31. import org.slf4j.Logger;
  32. import org.slf4j.LoggerFactory;
  33. @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
  34. @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-03-28")
  35. public class BuildStatusResponse implements org.apache.thrift.TBase<BuildStatusResponse, BuildStatusResponse._Fields>, java.io.Serializable, Cloneable, Comparable<BuildStatusResponse> {
  36. private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BuildStatusResponse");
  37. private static final org.apache.thrift.protocol.TField BUILD_JOB_FIELD_DESC = new org.apache.thrift.protocol.TField("buildJob", org.apache.thrift.protocol.TType.STRUCT, (short)1);
  38. private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  39. static {
  40. schemes.put(StandardScheme.class, new BuildStatusResponseStandardSchemeFactory());
  41. schemes.put(TupleScheme.class, new BuildStatusResponseTupleSchemeFactory());
  42. }
  43. public BuildJob buildJob; // optional
  44. /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  45. public enum _Fields implements org.apache.thrift.TFieldIdEnum {
  46. BUILD_JOB((short)1, "buildJob");
  47. private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  48. static {
  49. for (_Fields field : EnumSet.allOf(_Fields.class)) {
  50. byName.put(field.getFieldName(), field);
  51. }
  52. }
  53. /**
  54. * Find the _Fields constant that matches fieldId, or null if its not found.
  55. */
  56. public static _Fields findByThriftId(int fieldId) {
  57. switch(fieldId) {
  58. case 1: // BUILD_JOB
  59. return BUILD_JOB;
  60. default:
  61. return null;
  62. }
  63. }
  64. /**
  65. * Find the _Fields constant that matches fieldId, throwing an exception
  66. * if it is not found.
  67. */
  68. public static _Fields findByThriftIdOrThrow(int fieldId) {
  69. _Fields fields = findByThriftId(fieldId);
  70. if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
  71. return fields;
  72. }
  73. /**
  74. * Find the _Fields constant that matches name, or null if its not found.
  75. */
  76. public static _Fields findByName(String name) {
  77. return byName.get(name);
  78. }
  79. private final short _thriftId;
  80. private final String _fieldName;
  81. _Fields(short thriftId, String fieldName) {
  82. _thriftId = thriftId;
  83. _fieldName = fieldName;
  84. }
  85. public short getThriftFieldId() {
  86. return _thriftId;
  87. }
  88. public String getFieldName() {
  89. return _fieldName;
  90. }
  91. }
  92. // isset id assignments
  93. private static final _Fields optionals[] = {_Fields.BUILD_JOB};
  94. public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  95. static {
  96. Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
  97. tmpMap.put(_Fields.BUILD_JOB, new org.apache.thrift.meta_data.FieldMetaData("buildJob", org.apache.thrift.TFieldRequirementType.OPTIONAL,
  98. new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BuildJob.class)));
  99. metaDataMap = Collections.unmodifiableMap(tmpMap);
  100. org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BuildStatusResponse.class, metaDataMap);
  101. }
  102. public BuildStatusResponse() {
  103. }
  104. /**
  105. * Performs a deep copy on <i>other</i>.
  106. */
  107. public BuildStatusResponse(BuildStatusResponse other) {
  108. if (other.isSetBuildJob()) {
  109. this.buildJob = new BuildJob(other.buildJob);
  110. }
  111. }
  112. public BuildStatusResponse deepCopy() {
  113. return new BuildStatusResponse(this);
  114. }
  115. @Override
  116. public void clear() {
  117. this.buildJob = null;
  118. }
  119. public BuildJob getBuildJob() {
  120. return this.buildJob;
  121. }
  122. public BuildStatusResponse setBuildJob(BuildJob buildJob) {
  123. this.buildJob = buildJob;
  124. return this;
  125. }
  126. public void unsetBuildJob() {
  127. this.buildJob = null;
  128. }
  129. /** Returns true if field buildJob is set (has been assigned a value) and false otherwise */
  130. public boolean isSetBuildJob() {
  131. return this.buildJob != null;
  132. }
  133. public void setBuildJobIsSet(boolean value) {
  134. if (!value) {
  135. this.buildJob = null;
  136. }
  137. }
  138. public void setFieldValue(_Fields field, Object value) {
  139. switch (field) {
  140. case BUILD_JOB:
  141. if (value == null) {
  142. unsetBuildJob();
  143. } else {
  144. setBuildJob((BuildJob)value);
  145. }
  146. break;
  147. }
  148. }
  149. public Object getFieldValue(_Fields field) {
  150. switch (field) {
  151. case BUILD_JOB:
  152. return getBuildJob();
  153. }
  154. throw new IllegalStateException();
  155. }
  156. /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  157. public boolean isSet(_Fields field) {
  158. if (field == null) {
  159. throw new IllegalArgumentException();
  160. }
  161. switch (field) {
  162. case BUILD_JOB:
  163. return isSetBuildJob();
  164. }
  165. throw new IllegalStateException();
  166. }
  167. @Override
  168. public boolean equals(Object that) {
  169. if (that == null)
  170. return false;
  171. if (that instanceof BuildStatusResponse)
  172. return this.equals((BuildStatusResponse)that);
  173. return false;
  174. }
  175. public boolean equals(BuildStatusResponse that) {
  176. if (that == null)
  177. return false;
  178. boolean this_present_buildJob = true && this.isSetBuildJob();
  179. boolean that_present_buildJob = true && that.isSetBuildJob();
  180. if (this_present_buildJob || that_present_buildJob) {
  181. if (!(this_present_buildJob && that_present_buildJob))
  182. return false;
  183. if (!this.buildJob.equals(that.buildJob))
  184. return false;
  185. }
  186. return true;
  187. }
  188. @Override
  189. public int hashCode() {
  190. List<Object> list = new ArrayList<Object>();
  191. boolean present_buildJob = true && (isSetBuildJob());
  192. list.add(present_buildJob);
  193. if (present_buildJob)
  194. list.add(buildJob);
  195. return list.hashCode();
  196. }
  197. @Override
  198. public int compareTo(BuildStatusResponse other) {
  199. if (!getClass().equals(other.getClass())) {
  200. return getClass().getName().compareTo(other.getClass().getName());
  201. }
  202. int lastComparison = 0;
  203. lastComparison = Boolean.valueOf(isSetBuildJob()).compareTo(other.isSetBuildJob());
  204. if (lastComparison != 0) {
  205. return lastComparison;
  206. }
  207. if (isSetBuildJob()) {
  208. lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.buildJob, other.buildJob);
  209. if (lastComparison != 0) {
  210. return lastComparison;
  211. }
  212. }
  213. return 0;
  214. }
  215. public _Fields fieldForId(int fieldId) {
  216. return _Fields.findByThriftId(fieldId);
  217. }
  218. public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
  219. schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  220. }
  221. public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
  222. schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  223. }
  224. @Override
  225. public String toString() {
  226. StringBuilder sb = new StringBuilder("BuildStatusResponse(");
  227. boolean first = true;
  228. if (isSetBuildJob()) {
  229. sb.append("buildJob:");
  230. if (this.buildJob == null) {
  231. sb.append("null");
  232. } else {
  233. sb.append(this.buildJob);
  234. }
  235. first = false;
  236. }
  237. sb.append(")");
  238. return sb.toString();
  239. }
  240. public void validate() throws org.apache.thrift.TException {
  241. // check for required fields
  242. // check for sub-struct validity
  243. if (buildJob != null) {
  244. buildJob.validate();
  245. }
  246. }
  247. private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
  248. try {
  249. write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
  250. } catch (org.apache.thrift.TException te) {
  251. throw new java.io.IOException(te);
  252. }
  253. }
  254. private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
  255. try {
  256. read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
  257. } catch (org.apache.thrift.TException te) {
  258. throw new java.io.IOException(te);
  259. }
  260. }
  261. private static class BuildStatusResponseStandardSchemeFactory implements SchemeFactory {
  262. public BuildStatusResponseStandardScheme getScheme() {
  263. return new BuildStatusResponseStandardScheme();
  264. }
  265. }
  266. private static class BuildStatusResponseStandardScheme extends StandardScheme<BuildStatusResponse> {
  267. public void read(org.apache.thrift.protocol.TProtocol iprot, BuildStatusResponse struct) throws org.apache.thrift.TException {
  268. org.apache.thrift.protocol.TField schemeField;
  269. iprot.readStructBegin();
  270. while (true)
  271. {
  272. schemeField = iprot.readFieldBegin();
  273. if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
  274. break;
  275. }
  276. switch (schemeField.id) {
  277. case 1: // BUILD_JOB
  278. if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
  279. struct.buildJob = new BuildJob();
  280. struct.buildJob.read(iprot);
  281. struct.setBuildJobIsSet(true);
  282. } else {
  283. org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
  284. }
  285. break;
  286. default:
  287. org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
  288. }
  289. iprot.readFieldEnd();
  290. }
  291. iprot.readStructEnd();
  292. // check for required fields of primitive type, which can't be checked in the validate method
  293. struct.validate();
  294. }
  295. public void write(org.apache.thrift.protocol.TProtocol oprot, BuildStatusResponse struct) throws org.apache.thrift.TException {
  296. struct.validate();
  297. oprot.writeStructBegin(STRUCT_DESC);
  298. if (struct.buildJob != null) {
  299. if (struct.isSetBuildJob()) {
  300. oprot.writeFieldBegin(BUILD_JOB_FIELD_DESC);
  301. struct.buildJob.write(oprot);
  302. oprot.writeFieldEnd();
  303. }
  304. }
  305. oprot.writeFieldStop();
  306. oprot.writeStructEnd();
  307. }
  308. }
  309. private static class BuildStatusResponseTupleSchemeFactory implements SchemeFactory {
  310. public BuildStatusResponseTupleScheme getScheme() {
  311. return new BuildStatusResponseTupleScheme();
  312. }
  313. }
  314. private static class BuildStatusResponseTupleScheme extends TupleScheme<BuildStatusResponse> {
  315. @Override
  316. public void write(org.apache.thrift.protocol.TProtocol prot, BuildStatusResponse struct) throws org.apache.thrift.TException {
  317. TTupleProtocol oprot = (TTupleProtocol) prot;
  318. BitSet optionals = new BitSet();
  319. if (struct.isSetBuildJob()) {
  320. optionals.set(0);
  321. }
  322. oprot.writeBitSet(optionals, 1);
  323. if (struct.isSetBuildJob()) {
  324. struct.buildJob.write(oprot);
  325. }
  326. }
  327. @Override
  328. public void read(org.apache.thrift.protocol.TProtocol prot, BuildStatusResponse struct) throws org.apache.thrift.TException {
  329. TTupleProtocol iprot = (TTupleProtocol) prot;
  330. BitSet incoming = iprot.readBitSet(1);
  331. if (incoming.get(0)) {
  332. struct.buildJob = new BuildJob();
  333. struct.buildJob.read(iprot);
  334. struct.setBuildJobIsSet(true);
  335. }
  336. }
  337. }
  338. }