blob: 2a485e82a0302014793708c8d6f78138940b0c5d [file] [log] [blame]
eletuchyb8f0d492007-09-19 01:23:19 +00001/**
2 * Autogenerated by Thrift
3 *
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 */
6package com.facebook.thrift.reflection.limited;
7
8import java.util.ArrayList;
9import java.util.AbstractMap;
10import java.util.HashMap;
11import java.util.HashSet;
12import com.facebook.thrift.*;
13
14import com.facebook.thrift.protocol.*;
15import com.facebook.thrift.transport.*;
16
17public class Argument implements java.io.Serializable {
18 public short key;
19 public String name;
20 public ThriftType type;
21
22 public final Isset __isset = new Isset();
23 public static final class Isset {
24 public boolean key = false;
25 public boolean name = false;
26 public boolean type = false;
27 }
28
29 public Argument() {
30 }
31
32 public Argument(
33 short key,
34 String name,
35 ThriftType type)
36 {
37 this();
38 this.key = key;
39 this.__isset.key = true;
40 this.name = name;
41 this.__isset.name = true;
42 this.type = type;
43 this.__isset.type = true;
44 }
45
46 public void read(TProtocol iprot) throws TException {
47 TField field;
48 iprot.readStructBegin();
49 while (true)
50 {
51 field = iprot.readFieldBegin();
David Reiss0c90f6f2008-02-06 22:18:40 +000052 if (field.type == TType.STOP) {
eletuchyb8f0d492007-09-19 01:23:19 +000053 break;
54 }
55 switch (field.id)
56 {
57 case 1:
58 if (field.type == TType.I16) {
59 this.key = iprot.readI16();
60 this.__isset.key = true;
David Reiss0c90f6f2008-02-06 22:18:40 +000061 } else {
eletuchyb8f0d492007-09-19 01:23:19 +000062 TProtocolUtil.skip(iprot, field.type);
63 }
64 break;
65 case 2:
66 if (field.type == TType.STRING) {
67 this.name = iprot.readString();
68 this.__isset.name = true;
David Reiss0c90f6f2008-02-06 22:18:40 +000069 } else {
eletuchyb8f0d492007-09-19 01:23:19 +000070 TProtocolUtil.skip(iprot, field.type);
71 }
72 break;
73 case 3:
74 if (field.type == TType.STRUCT) {
75 this.type = new ThriftType();
76 this.type.read(iprot);
77 this.__isset.type = true;
David Reiss0c90f6f2008-02-06 22:18:40 +000078 } else {
eletuchyb8f0d492007-09-19 01:23:19 +000079 TProtocolUtil.skip(iprot, field.type);
80 }
81 break;
82 default:
83 TProtocolUtil.skip(iprot, field.type);
84 break;
85 }
86 iprot.readFieldEnd();
87 }
88 iprot.readStructEnd();
89 }
90
91 public void write(TProtocol oprot) throws TException {
92 TStruct struct = new TStruct("Argument");
93 oprot.writeStructBegin(struct);
94 TField field = new TField();
95 field.name = "key";
96 field.type = TType.I16;
97 field.id = 1;
98 oprot.writeFieldBegin(field);
99 oprot.writeI16(this.key);
100 oprot.writeFieldEnd();
101 if (this.name != null) {
102 field.name = "name";
103 field.type = TType.STRING;
104 field.id = 2;
105 oprot.writeFieldBegin(field);
106 oprot.writeString(this.name);
107 oprot.writeFieldEnd();
108 }
109 if (this.type != null) {
110 field.name = "type";
111 field.type = TType.STRUCT;
112 field.id = 3;
113 oprot.writeFieldBegin(field);
114 this.type.write(oprot);
115 oprot.writeFieldEnd();
116 }
117 oprot.writeFieldStop();
118 oprot.writeStructEnd();
119 }
120
121 public String toString() {
122 StringBuilder sb = new StringBuilder("Argument(");
123 sb.append("key:");
124 sb.append(this.key);
125 sb.append(",name:");
126 sb.append(this.name);
127 sb.append(",type:");
128 sb.append(this.type.toString());
129 sb.append(")");
130 return sb.toString();
131 }
132
133}
134