1
2
3
4
5
6
7 package org.apache.hadoop.hbase.thrift.generated;
8
9 import org.apache.thrift.scheme.IScheme;
10 import org.apache.thrift.scheme.SchemeFactory;
11 import org.apache.thrift.scheme.StandardScheme;
12
13 import org.apache.thrift.scheme.TupleScheme;
14 import org.apache.thrift.protocol.TTupleProtocol;
15 import java.util.List;
16 import java.util.ArrayList;
17 import java.util.Map;
18 import java.util.HashMap;
19 import java.util.EnumMap;
20 import java.util.Set;
21 import java.util.HashSet;
22 import java.util.EnumSet;
23 import java.util.Collections;
24 import java.util.BitSet;
25 import java.nio.ByteBuffer;
26 import java.util.Arrays;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29
30
31
32
33
34 public class AlreadyExists extends Exception implements org.apache.thrift.TBase<AlreadyExists, AlreadyExists._Fields>, java.io.Serializable, Cloneable {
35 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AlreadyExists");
36
37 private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
38
39 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
40 static {
41 schemes.put(StandardScheme.class, new AlreadyExistsStandardSchemeFactory());
42 schemes.put(TupleScheme.class, new AlreadyExistsTupleSchemeFactory());
43 }
44
45 public String message;
46
47
48 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
49 MESSAGE((short)1, "message");
50
51 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
52
53 static {
54 for (_Fields field : EnumSet.allOf(_Fields.class)) {
55 byName.put(field.getFieldName(), field);
56 }
57 }
58
59
60
61
62 public static _Fields findByThriftId(int fieldId) {
63 switch(fieldId) {
64 case 1:
65 return MESSAGE;
66 default:
67 return null;
68 }
69 }
70
71
72
73
74
75 public static _Fields findByThriftIdOrThrow(int fieldId) {
76 _Fields fields = findByThriftId(fieldId);
77 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
78 return fields;
79 }
80
81
82
83
84 public static _Fields findByName(String name) {
85 return byName.get(name);
86 }
87
88 private final short _thriftId;
89 private final String _fieldName;
90
91 _Fields(short thriftId, String fieldName) {
92 _thriftId = thriftId;
93 _fieldName = fieldName;
94 }
95
96 public short getThriftFieldId() {
97 return _thriftId;
98 }
99
100 public String getFieldName() {
101 return _fieldName;
102 }
103 }
104
105
106 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
107 static {
108 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
109 tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
110 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
111 metaDataMap = Collections.unmodifiableMap(tmpMap);
112 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AlreadyExists.class, metaDataMap);
113 }
114
115 public AlreadyExists() {
116 }
117
118 public AlreadyExists(
119 String message)
120 {
121 this();
122 this.message = message;
123 }
124
125
126
127
128 public AlreadyExists(AlreadyExists other) {
129 if (other.isSetMessage()) {
130 this.message = other.message;
131 }
132 }
133
134 public AlreadyExists deepCopy() {
135 return new AlreadyExists(this);
136 }
137
138 @Override
139 public void clear() {
140 this.message = null;
141 }
142
143 public String getMessage() {
144 return this.message;
145 }
146
147 public AlreadyExists setMessage(String message) {
148 this.message = message;
149 return this;
150 }
151
152 public void unsetMessage() {
153 this.message = null;
154 }
155
156
157 public boolean isSetMessage() {
158 return this.message != null;
159 }
160
161 public void setMessageIsSet(boolean value) {
162 if (!value) {
163 this.message = null;
164 }
165 }
166
167 public void setFieldValue(_Fields field, Object value) {
168 switch (field) {
169 case MESSAGE:
170 if (value == null) {
171 unsetMessage();
172 } else {
173 setMessage((String)value);
174 }
175 break;
176
177 }
178 }
179
180 public Object getFieldValue(_Fields field) {
181 switch (field) {
182 case MESSAGE:
183 return getMessage();
184
185 }
186 throw new IllegalStateException();
187 }
188
189
190 public boolean isSet(_Fields field) {
191 if (field == null) {
192 throw new IllegalArgumentException();
193 }
194
195 switch (field) {
196 case MESSAGE:
197 return isSetMessage();
198 }
199 throw new IllegalStateException();
200 }
201
202 @Override
203 public boolean equals(Object that) {
204 if (that == null)
205 return false;
206 if (that instanceof AlreadyExists)
207 return this.equals((AlreadyExists)that);
208 return false;
209 }
210
211 public boolean equals(AlreadyExists that) {
212 if (that == null)
213 return false;
214
215 boolean this_present_message = true && this.isSetMessage();
216 boolean that_present_message = true && that.isSetMessage();
217 if (this_present_message || that_present_message) {
218 if (!(this_present_message && that_present_message))
219 return false;
220 if (!this.message.equals(that.message))
221 return false;
222 }
223
224 return true;
225 }
226
227 @Override
228 public int hashCode() {
229 return 0;
230 }
231
232 public int compareTo(AlreadyExists other) {
233 if (!getClass().equals(other.getClass())) {
234 return getClass().getName().compareTo(other.getClass().getName());
235 }
236
237 int lastComparison = 0;
238 AlreadyExists typedOther = (AlreadyExists)other;
239
240 lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage());
241 if (lastComparison != 0) {
242 return lastComparison;
243 }
244 if (isSetMessage()) {
245 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message);
246 if (lastComparison != 0) {
247 return lastComparison;
248 }
249 }
250 return 0;
251 }
252
253 public _Fields fieldForId(int fieldId) {
254 return _Fields.findByThriftId(fieldId);
255 }
256
257 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
258 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
259 }
260
261 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
262 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
263 }
264
265 @Override
266 public String toString() {
267 StringBuilder sb = new StringBuilder("AlreadyExists(");
268 boolean first = true;
269
270 sb.append("message:");
271 if (this.message == null) {
272 sb.append("null");
273 } else {
274 sb.append(this.message);
275 }
276 first = false;
277 sb.append(")");
278 return sb.toString();
279 }
280
281 public void validate() throws org.apache.thrift.TException {
282
283 }
284
285 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
286 try {
287 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
288 } catch (org.apache.thrift.TException te) {
289 throw new java.io.IOException(te);
290 }
291 }
292
293 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
294 try {
295 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
296 } catch (org.apache.thrift.TException te) {
297 throw new java.io.IOException(te);
298 }
299 }
300
301 private static class AlreadyExistsStandardSchemeFactory implements SchemeFactory {
302 public AlreadyExistsStandardScheme getScheme() {
303 return new AlreadyExistsStandardScheme();
304 }
305 }
306
307 private static class AlreadyExistsStandardScheme extends StandardScheme<AlreadyExists> {
308
309 public void read(org.apache.thrift.protocol.TProtocol iprot, AlreadyExists struct) throws org.apache.thrift.TException {
310 org.apache.thrift.protocol.TField schemeField;
311 iprot.readStructBegin();
312 while (true)
313 {
314 schemeField = iprot.readFieldBegin();
315 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
316 break;
317 }
318 switch (schemeField.id) {
319 case 1:
320 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
321 struct.message = iprot.readString();
322 struct.setMessageIsSet(true);
323 } else {
324 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
325 }
326 break;
327 default:
328 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
329 }
330 iprot.readFieldEnd();
331 }
332 iprot.readStructEnd();
333
334
335 struct.validate();
336 }
337
338 public void write(org.apache.thrift.protocol.TProtocol oprot, AlreadyExists struct) throws org.apache.thrift.TException {
339 struct.validate();
340
341 oprot.writeStructBegin(STRUCT_DESC);
342 if (struct.message != null) {
343 oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
344 oprot.writeString(struct.message);
345 oprot.writeFieldEnd();
346 }
347 oprot.writeFieldStop();
348 oprot.writeStructEnd();
349 }
350
351 }
352
353 private static class AlreadyExistsTupleSchemeFactory implements SchemeFactory {
354 public AlreadyExistsTupleScheme getScheme() {
355 return new AlreadyExistsTupleScheme();
356 }
357 }
358
359 private static class AlreadyExistsTupleScheme extends TupleScheme<AlreadyExists> {
360
361 @Override
362 public void write(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException {
363 TTupleProtocol oprot = (TTupleProtocol) prot;
364 BitSet optionals = new BitSet();
365 if (struct.isSetMessage()) {
366 optionals.set(0);
367 }
368 oprot.writeBitSet(optionals, 1);
369 if (struct.isSetMessage()) {
370 oprot.writeString(struct.message);
371 }
372 }
373
374 @Override
375 public void read(org.apache.thrift.protocol.TProtocol prot, AlreadyExists struct) throws org.apache.thrift.TException {
376 TTupleProtocol iprot = (TTupleProtocol) prot;
377 BitSet incoming = iprot.readBitSet(1);
378 if (incoming.get(0)) {
379 struct.message = iprot.readString();
380 struct.setMessageIsSet(true);
381 }
382 }
383 }
384
385 }
386