Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.76 KB | None | 0 0
  1. @Generated("Apollo GraphQL")
  2. public final class RandomWebmQuery implements Query<RandomWebmQuery.Data, RandomWebmQuery.Data, Operation.Variables> {
  3. public static final String OPERATION_DEFINITION = "query RandomWebm {\n"
  4. + " getWebm {\n"
  5. + " __typename\n"
  6. + " id\n"
  7. + " source\n"
  8. + " views\n"
  9. + " url\n"
  10. + " likes\n"
  11. + " dislikes\n"
  12. + " createdAt\n"
  13. + " tags {\n"
  14. + " __typename\n"
  15. + " id\n"
  16. + " name\n"
  17. + " }\n"
  18. + " }\n"
  19. + "}";
  20.  
  21. public static final String QUERY_DOCUMENT = OPERATION_DEFINITION;
  22.  
  23. private static final OperationName OPERATION_NAME = new OperationName() {
  24. @Override
  25. public String name() {
  26. return "RandomWebm";
  27. }
  28. };
  29.  
  30. private final Operation.Variables variables;
  31.  
  32. public RandomWebmQuery() {
  33. this.variables = Operation.EMPTY_VARIABLES;
  34. }
  35.  
  36. @Override
  37. public String operationId() {
  38. return "64e1e7e3e3e286adb0040c9b49a6d7261da0968e475136f94450b74af6443d1c";
  39. }
  40.  
  41. @Override
  42. public String queryDocument() {
  43. return QUERY_DOCUMENT;
  44. }
  45.  
  46. @Override
  47. public RandomWebmQuery.Data wrapData(RandomWebmQuery.Data data) {
  48. return data;
  49. }
  50.  
  51. @Override
  52. public Operation.Variables variables() {
  53. return variables;
  54. }
  55.  
  56. @Override
  57. public ResponseFieldMapper<RandomWebmQuery.Data> responseFieldMapper() {
  58. return new Data.Mapper();
  59. }
  60.  
  61. public static Builder builder() {
  62. return new Builder();
  63. }
  64.  
  65. @Override
  66. public OperationName name() {
  67. return OPERATION_NAME;
  68. }
  69.  
  70. public static final class Builder {
  71. Builder() {
  72. }
  73.  
  74. public RandomWebmQuery build() {
  75. return new RandomWebmQuery();
  76. }
  77. }
  78.  
  79. public static class Data implements Operation.Data {
  80. static final ResponseField[] $responseFields = {
  81. ResponseField.forObject("getWebm", "getWebm", null, true, Collections.<ResponseField.Condition>emptyList())
  82. };
  83.  
  84. final @Nullable GetWebm getWebm;
  85.  
  86. private volatile String $toString;
  87.  
  88. private volatile int $hashCode;
  89.  
  90. private volatile boolean $hashCodeMemoized;
  91.  
  92. public Data(@Nullable GetWebm getWebm) {
  93. this.getWebm = getWebm;
  94. }
  95.  
  96. public @Nullable GetWebm getWebm() {
  97. return this.getWebm;
  98. }
  99.  
  100. public ResponseFieldMarshaller marshaller() {
  101. return new ResponseFieldMarshaller() {
  102. @Override
  103. public void marshal(ResponseWriter writer) {
  104. writer.writeObject($responseFields[0], getWebm != null ? getWebm.marshaller() : null);
  105. }
  106. };
  107. }
  108.  
  109. @Override
  110. public String toString() {
  111. if ($toString == null) {
  112. $toString = "Data{"
  113. + "getWebm=" + getWebm
  114. + "}";
  115. }
  116. return $toString;
  117. }
  118.  
  119. @Override
  120. public boolean equals(Object o) {
  121. if (o == this) {
  122. return true;
  123. }
  124. if (o instanceof Data) {
  125. Data that = (Data) o;
  126. return ((this.getWebm == null) ? (that.getWebm == null) : this.getWebm.equals(that.getWebm));
  127. }
  128. return false;
  129. }
  130.  
  131. @Override
  132. public int hashCode() {
  133. if (!$hashCodeMemoized) {
  134. int h = 1;
  135. h *= 1000003;
  136. h ^= (getWebm == null) ? 0 : getWebm.hashCode();
  137. $hashCode = h;
  138. $hashCodeMemoized = true;
  139. }
  140. return $hashCode;
  141. }
  142.  
  143. public static final class Mapper implements ResponseFieldMapper<Data> {
  144. final GetWebm.Mapper getWebmFieldMapper = new GetWebm.Mapper();
  145.  
  146. @Override
  147. public Data map(ResponseReader reader) {
  148. final GetWebm getWebm = reader.readObject($responseFields[0], new ResponseReader.ObjectReader<GetWebm>() {
  149. @Override
  150. public GetWebm read(ResponseReader reader) {
  151. return getWebmFieldMapper.map(reader);
  152. }
  153. });
  154. return new Data(getWebm);
  155. }
  156. }
  157. }
  158.  
  159. public static class GetWebm {
  160. static final ResponseField[] $responseFields = {
  161. ResponseField.forString("__typename", "__typename", null, false, Collections.<ResponseField.Condition>emptyList()),
  162. ResponseField.forCustomType("id", "id", null, false, CustomType.ID, Collections.<ResponseField.Condition>emptyList()),
  163. ResponseField.forString("source", "source", null, true, Collections.<ResponseField.Condition>emptyList()),
  164. ResponseField.forInt("views", "views", null, false, Collections.<ResponseField.Condition>emptyList()),
  165. ResponseField.forString("url", "url", null, false, Collections.<ResponseField.Condition>emptyList()),
  166. ResponseField.forInt("likes", "likes", null, false, Collections.<ResponseField.Condition>emptyList()),
  167. ResponseField.forInt("dislikes", "dislikes", null, false, Collections.<ResponseField.Condition>emptyList()),
  168. ResponseField.forString("createdAt", "createdAt", null, false, Collections.<ResponseField.Condition>emptyList()),
  169. ResponseField.forObjectList("tags", "tags", null, true, Collections.<ResponseField.Condition>emptyList())
  170. };
  171.  
  172. final @Nonnull String __typename;
  173.  
  174. final @Nonnull String id;
  175.  
  176. final @Nullable String source;
  177.  
  178. final int views;
  179.  
  180. final @Nonnull String url;
  181.  
  182. final int likes;
  183.  
  184. final int dislikes;
  185.  
  186. final @Nonnull String createdAt;
  187.  
  188. final @Nullable List<Tag> tags;
  189.  
  190. private volatile String $toString;
  191.  
  192. private volatile int $hashCode;
  193.  
  194. private volatile boolean $hashCodeMemoized;
  195.  
  196. public GetWebm(@Nonnull String __typename, @Nonnull String id, @Nullable String source,
  197. int views, @Nonnull String url, int likes, int dislikes, @Nonnull String createdAt,
  198. @Nullable List<Tag> tags) {
  199. this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  200. this.id = Utils.checkNotNull(id, "id == null");
  201. this.source = source;
  202. this.views = views;
  203. this.url = Utils.checkNotNull(url, "url == null");
  204. this.likes = likes;
  205. this.dislikes = dislikes;
  206. this.createdAt = Utils.checkNotNull(createdAt, "createdAt == null");
  207. this.tags = tags;
  208. }
  209.  
  210. public @Nonnull String __typename() {
  211. return this.__typename;
  212. }
  213.  
  214. public @Nonnull String id() {
  215. return this.id;
  216. }
  217.  
  218. public @Nullable String source() {
  219. return this.source;
  220. }
  221.  
  222. public int views() {
  223. return this.views;
  224. }
  225.  
  226. public @Nonnull String url() {
  227. return this.url;
  228. }
  229.  
  230. public int likes() {
  231. return this.likes;
  232. }
  233.  
  234. public int dislikes() {
  235. return this.dislikes;
  236. }
  237.  
  238. public @Nonnull String createdAt() {
  239. return this.createdAt;
  240. }
  241.  
  242. public @Nullable List<Tag> tags() {
  243. return this.tags;
  244. }
  245.  
  246. public ResponseFieldMarshaller marshaller() {
  247. return new ResponseFieldMarshaller() {
  248. @Override
  249. public void marshal(ResponseWriter writer) {
  250. writer.writeString($responseFields[0], __typename);
  251. writer.writeCustom((ResponseField.CustomTypeField) $responseFields[1], id);
  252. writer.writeString($responseFields[2], source);
  253. writer.writeInt($responseFields[3], views);
  254. writer.writeString($responseFields[4], url);
  255. writer.writeInt($responseFields[5], likes);
  256. writer.writeInt($responseFields[6], dislikes);
  257. writer.writeString($responseFields[7], createdAt);
  258. writer.writeList($responseFields[8], tags != null ? new ResponseWriter.ListWriter() {
  259. @Override
  260. public void write(ResponseWriter.ListItemWriter listItemWriter) {
  261. for (Tag $item : tags) {
  262. listItemWriter.writeObject($item.marshaller());
  263. }
  264. }
  265. } : null);
  266. }
  267. };
  268. }
  269.  
  270. @Override
  271. public String toString() {
  272. if ($toString == null) {
  273. $toString = "GetWebm{"
  274. + "__typename=" + __typename + ", "
  275. + "id=" + id + ", "
  276. + "source=" + source + ", "
  277. + "views=" + views + ", "
  278. + "url=" + url + ", "
  279. + "likes=" + likes + ", "
  280. + "dislikes=" + dislikes + ", "
  281. + "createdAt=" + createdAt + ", "
  282. + "tags=" + tags
  283. + "}";
  284. }
  285. return $toString;
  286. }
  287.  
  288. @Override
  289. public boolean equals(Object o) {
  290. if (o == this) {
  291. return true;
  292. }
  293. if (o instanceof GetWebm) {
  294. GetWebm that = (GetWebm) o;
  295. return this.__typename.equals(that.__typename)
  296. && this.id.equals(that.id)
  297. && ((this.source == null) ? (that.source == null) : this.source.equals(that.source))
  298. && this.views == that.views
  299. && this.url.equals(that.url)
  300. && this.likes == that.likes
  301. && this.dislikes == that.dislikes
  302. && this.createdAt.equals(that.createdAt)
  303. && ((this.tags == null) ? (that.tags == null) : this.tags.equals(that.tags));
  304. }
  305. return false;
  306. }
  307.  
  308. @Override
  309. public int hashCode() {
  310. if (!$hashCodeMemoized) {
  311. int h = 1;
  312. h *= 1000003;
  313. h ^= __typename.hashCode();
  314. h *= 1000003;
  315. h ^= id.hashCode();
  316. h *= 1000003;
  317. h ^= (source == null) ? 0 : source.hashCode();
  318. h *= 1000003;
  319. h ^= views;
  320. h *= 1000003;
  321. h ^= url.hashCode();
  322. h *= 1000003;
  323. h ^= likes;
  324. h *= 1000003;
  325. h ^= dislikes;
  326. h *= 1000003;
  327. h ^= createdAt.hashCode();
  328. h *= 1000003;
  329. h ^= (tags == null) ? 0 : tags.hashCode();
  330. $hashCode = h;
  331. $hashCodeMemoized = true;
  332. }
  333. return $hashCode;
  334. }
  335.  
  336. public static final class Mapper implements ResponseFieldMapper<GetWebm> {
  337. final Tag.Mapper tagFieldMapper = new Tag.Mapper();
  338.  
  339. @Override
  340. public GetWebm map(ResponseReader reader) {
  341. final String __typename = reader.readString($responseFields[0]);
  342. final String id = reader.readCustomType((ResponseField.CustomTypeField) $responseFields[1]);
  343. final String source = reader.readString($responseFields[2]);
  344. final int views = reader.readInt($responseFields[3]);
  345. final String url = reader.readString($responseFields[4]);
  346. final int likes = reader.readInt($responseFields[5]);
  347. final int dislikes = reader.readInt($responseFields[6]);
  348. final String createdAt = reader.readString($responseFields[7]);
  349. final List<Tag> tags = reader.readList($responseFields[8], new ResponseReader.ListReader<Tag>() {
  350. @Override
  351. public Tag read(ResponseReader.ListItemReader reader) {
  352. return reader.readObject(new ResponseReader.ObjectReader<Tag>() {
  353. @Override
  354. public Tag read(ResponseReader reader) {
  355. return tagFieldMapper.map(reader);
  356. }
  357. });
  358. }
  359. });
  360. return new GetWebm(__typename, id, source, views, url, likes, dislikes, createdAt, tags);
  361. }
  362. }
  363. }
  364.  
  365. public static class Tag {
  366. static final ResponseField[] $responseFields = {
  367. ResponseField.forString("__typename", "__typename", null, false, Collections.<ResponseField.Condition>emptyList()),
  368. ResponseField.forInt("id", "id", null, false, Collections.<ResponseField.Condition>emptyList()),
  369. ResponseField.forString("name", "name", null, false, Collections.<ResponseField.Condition>emptyList())
  370. };
  371.  
  372. final @Nonnull String __typename;
  373.  
  374. final int id;
  375.  
  376. final @Nonnull String name;
  377.  
  378. private volatile String $toString;
  379.  
  380. private volatile int $hashCode;
  381.  
  382. private volatile boolean $hashCodeMemoized;
  383.  
  384. public Tag(@Nonnull String __typename, int id, @Nonnull String name) {
  385. this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  386. this.id = id;
  387. this.name = Utils.checkNotNull(name, "name == null");
  388. }
  389.  
  390. public @Nonnull String __typename() {
  391. return this.__typename;
  392. }
  393.  
  394. public int id() {
  395. return this.id;
  396. }
  397.  
  398. public @Nonnull String name() {
  399. return this.name;
  400. }
  401.  
  402. public ResponseFieldMarshaller marshaller() {
  403. return new ResponseFieldMarshaller() {
  404. @Override
  405. public void marshal(ResponseWriter writer) {
  406. writer.writeString($responseFields[0], __typename);
  407. writer.writeInt($responseFields[1], id);
  408. writer.writeString($responseFields[2], name);
  409. }
  410. };
  411. }
  412.  
  413. @Override
  414. public String toString() {
  415. if ($toString == null) {
  416. $toString = "Tag{"
  417. + "__typename=" + __typename + ", "
  418. + "id=" + id + ", "
  419. + "name=" + name
  420. + "}";
  421. }
  422. return $toString;
  423. }
  424.  
  425. @Override
  426. public boolean equals(Object o) {
  427. if (o == this) {
  428. return true;
  429. }
  430. if (o instanceof Tag) {
  431. Tag that = (Tag) o;
  432. return this.__typename.equals(that.__typename)
  433. && this.id == that.id
  434. && this.name.equals(that.name);
  435. }
  436. return false;
  437. }
  438.  
  439. @Override
  440. public int hashCode() {
  441. if (!$hashCodeMemoized) {
  442. int h = 1;
  443. h *= 1000003;
  444. h ^= __typename.hashCode();
  445. h *= 1000003;
  446. h ^= id;
  447. h *= 1000003;
  448. h ^= name.hashCode();
  449. $hashCode = h;
  450. $hashCodeMemoized = true;
  451. }
  452. return $hashCode;
  453. }
  454.  
  455. public static final class Mapper implements ResponseFieldMapper<Tag> {
  456. @Override
  457. public Tag map(ResponseReader reader) {
  458. final String __typename = reader.readString($responseFields[0]);
  459. final int id = reader.readInt($responseFields[1]);
  460. final String name = reader.readString($responseFields[2]);
  461. return new Tag(__typename, id, name);
  462. }
  463. }
  464. }
  465. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement