View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  /**
18   * Autogenerated by Thrift Compiler (0.9.0)
19   *
20   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
21   *  @generated
22   */
23  package org.apache.accumulo.core.data.thrift;
24  
25  import org.apache.thrift.scheme.IScheme;
26  import org.apache.thrift.scheme.SchemeFactory;
27  import org.apache.thrift.scheme.StandardScheme;
28  
29  import org.apache.thrift.scheme.TupleScheme;
30  import org.apache.thrift.protocol.TTupleProtocol;
31  import org.apache.thrift.protocol.TProtocolException;
32  import org.apache.thrift.EncodingUtils;
33  import org.apache.thrift.TException;
34  import java.util.List;
35  import java.util.ArrayList;
36  import java.util.Map;
37  import java.util.HashMap;
38  import java.util.EnumMap;
39  import java.util.Set;
40  import java.util.HashSet;
41  import java.util.EnumSet;
42  import java.util.Collections;
43  import java.util.BitSet;
44  import java.nio.ByteBuffer;
45  import java.util.Arrays;
46  import org.slf4j.Logger;
47  import org.slf4j.LoggerFactory;
48  
49  @SuppressWarnings("all") public class TRange implements org.apache.thrift.TBase<TRange, TRange._Fields>, java.io.Serializable, Cloneable {
50    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRange");
51  
52    private static final org.apache.thrift.protocol.TField START_FIELD_DESC = new org.apache.thrift.protocol.TField("start", org.apache.thrift.protocol.TType.STRUCT, (short)1);
53    private static final org.apache.thrift.protocol.TField STOP_FIELD_DESC = new org.apache.thrift.protocol.TField("stop", org.apache.thrift.protocol.TType.STRUCT, (short)2);
54    private static final org.apache.thrift.protocol.TField START_KEY_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("startKeyInclusive", org.apache.thrift.protocol.TType.BOOL, (short)3);
55    private static final org.apache.thrift.protocol.TField STOP_KEY_INCLUSIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("stopKeyInclusive", org.apache.thrift.protocol.TType.BOOL, (short)4);
56    private static final org.apache.thrift.protocol.TField INFINITE_START_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStartKey", org.apache.thrift.protocol.TType.BOOL, (short)5);
57    private static final org.apache.thrift.protocol.TField INFINITE_STOP_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField("infiniteStopKey", org.apache.thrift.protocol.TType.BOOL, (short)6);
58  
59    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
60    static {
61      schemes.put(StandardScheme.class, new TRangeStandardSchemeFactory());
62      schemes.put(TupleScheme.class, new TRangeTupleSchemeFactory());
63    }
64  
65    public TKey start; // required
66    public TKey stop; // required
67    public boolean startKeyInclusive; // required
68    public boolean stopKeyInclusive; // required
69    public boolean infiniteStartKey; // required
70    public boolean infiniteStopKey; // required
71  
72    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
73    @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
74      START((short)1, "start"),
75      STOP((short)2, "stop"),
76      START_KEY_INCLUSIVE((short)3, "startKeyInclusive"),
77      STOP_KEY_INCLUSIVE((short)4, "stopKeyInclusive"),
78      INFINITE_START_KEY((short)5, "infiniteStartKey"),
79      INFINITE_STOP_KEY((short)6, "infiniteStopKey");
80  
81      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
82  
83      static {
84        for (_Fields field : EnumSet.allOf(_Fields.class)) {
85          byName.put(field.getFieldName(), field);
86        }
87      }
88  
89      /**
90       * Find the _Fields constant that matches fieldId, or null if its not found.
91       */
92      public static _Fields findByThriftId(int fieldId) {
93        switch(fieldId) {
94          case 1: // START
95            return START;
96          case 2: // STOP
97            return STOP;
98          case 3: // START_KEY_INCLUSIVE
99            return START_KEY_INCLUSIVE;
100         case 4: // STOP_KEY_INCLUSIVE
101           return STOP_KEY_INCLUSIVE;
102         case 5: // INFINITE_START_KEY
103           return INFINITE_START_KEY;
104         case 6: // INFINITE_STOP_KEY
105           return INFINITE_STOP_KEY;
106         default:
107           return null;
108       }
109     }
110 
111     /**
112      * Find the _Fields constant that matches fieldId, throwing an exception
113      * if it is not found.
114      */
115     public static _Fields findByThriftIdOrThrow(int fieldId) {
116       _Fields fields = findByThriftId(fieldId);
117       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
118       return fields;
119     }
120 
121     /**
122      * Find the _Fields constant that matches name, or null if its not found.
123      */
124     public static _Fields findByName(String name) {
125       return byName.get(name);
126     }
127 
128     private final short _thriftId;
129     private final String _fieldName;
130 
131     _Fields(short thriftId, String fieldName) {
132       _thriftId = thriftId;
133       _fieldName = fieldName;
134     }
135 
136     public short getThriftFieldId() {
137       return _thriftId;
138     }
139 
140     public String getFieldName() {
141       return _fieldName;
142     }
143   }
144 
145   // isset id assignments
146   private static final int __STARTKEYINCLUSIVE_ISSET_ID = 0;
147   private static final int __STOPKEYINCLUSIVE_ISSET_ID = 1;
148   private static final int __INFINITESTARTKEY_ISSET_ID = 2;
149   private static final int __INFINITESTOPKEY_ISSET_ID = 3;
150   private byte __isset_bitfield = 0;
151   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
152   static {
153     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
154     tmpMap.put(_Fields.START, new org.apache.thrift.meta_data.FieldMetaData("start", org.apache.thrift.TFieldRequirementType.DEFAULT, 
155         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKey.class)));
156     tmpMap.put(_Fields.STOP, new org.apache.thrift.meta_data.FieldMetaData("stop", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TKey.class)));
158     tmpMap.put(_Fields.START_KEY_INCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("startKeyInclusive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
159         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
160     tmpMap.put(_Fields.STOP_KEY_INCLUSIVE, new org.apache.thrift.meta_data.FieldMetaData("stopKeyInclusive", org.apache.thrift.TFieldRequirementType.DEFAULT, 
161         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
162     tmpMap.put(_Fields.INFINITE_START_KEY, new org.apache.thrift.meta_data.FieldMetaData("infiniteStartKey", org.apache.thrift.TFieldRequirementType.DEFAULT, 
163         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
164     tmpMap.put(_Fields.INFINITE_STOP_KEY, new org.apache.thrift.meta_data.FieldMetaData("infiniteStopKey", org.apache.thrift.TFieldRequirementType.DEFAULT, 
165         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
166     metaDataMap = Collections.unmodifiableMap(tmpMap);
167     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRange.class, metaDataMap);
168   }
169 
170   public TRange() {
171   }
172 
173   public TRange(
174     TKey start,
175     TKey stop,
176     boolean startKeyInclusive,
177     boolean stopKeyInclusive,
178     boolean infiniteStartKey,
179     boolean infiniteStopKey)
180   {
181     this();
182     this.start = start;
183     this.stop = stop;
184     this.startKeyInclusive = startKeyInclusive;
185     setStartKeyInclusiveIsSet(true);
186     this.stopKeyInclusive = stopKeyInclusive;
187     setStopKeyInclusiveIsSet(true);
188     this.infiniteStartKey = infiniteStartKey;
189     setInfiniteStartKeyIsSet(true);
190     this.infiniteStopKey = infiniteStopKey;
191     setInfiniteStopKeyIsSet(true);
192   }
193 
194   /**
195    * Performs a deep copy on <i>other</i>.
196    */
197   public TRange(TRange other) {
198     __isset_bitfield = other.__isset_bitfield;
199     if (other.isSetStart()) {
200       this.start = new TKey(other.start);
201     }
202     if (other.isSetStop()) {
203       this.stop = new TKey(other.stop);
204     }
205     this.startKeyInclusive = other.startKeyInclusive;
206     this.stopKeyInclusive = other.stopKeyInclusive;
207     this.infiniteStartKey = other.infiniteStartKey;
208     this.infiniteStopKey = other.infiniteStopKey;
209   }
210 
211   public TRange deepCopy() {
212     return new TRange(this);
213   }
214 
215   @Override
216   public void clear() {
217     this.start = null;
218     this.stop = null;
219     setStartKeyInclusiveIsSet(false);
220     this.startKeyInclusive = false;
221     setStopKeyInclusiveIsSet(false);
222     this.stopKeyInclusive = false;
223     setInfiniteStartKeyIsSet(false);
224     this.infiniteStartKey = false;
225     setInfiniteStopKeyIsSet(false);
226     this.infiniteStopKey = false;
227   }
228 
229   public TKey getStart() {
230     return this.start;
231   }
232 
233   public TRange setStart(TKey start) {
234     this.start = start;
235     return this;
236   }
237 
238   public void unsetStart() {
239     this.start = null;
240   }
241 
242   /** Returns true if field start is set (has been assigned a value) and false otherwise */
243   public boolean isSetStart() {
244     return this.start != null;
245   }
246 
247   public void setStartIsSet(boolean value) {
248     if (!value) {
249       this.start = null;
250     }
251   }
252 
253   public TKey getStop() {
254     return this.stop;
255   }
256 
257   public TRange setStop(TKey stop) {
258     this.stop = stop;
259     return this;
260   }
261 
262   public void unsetStop() {
263     this.stop = null;
264   }
265 
266   /** Returns true if field stop is set (has been assigned a value) and false otherwise */
267   public boolean isSetStop() {
268     return this.stop != null;
269   }
270 
271   public void setStopIsSet(boolean value) {
272     if (!value) {
273       this.stop = null;
274     }
275   }
276 
277   public boolean isStartKeyInclusive() {
278     return this.startKeyInclusive;
279   }
280 
281   public TRange setStartKeyInclusive(boolean startKeyInclusive) {
282     this.startKeyInclusive = startKeyInclusive;
283     setStartKeyInclusiveIsSet(true);
284     return this;
285   }
286 
287   public void unsetStartKeyInclusive() {
288     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTKEYINCLUSIVE_ISSET_ID);
289   }
290 
291   /** Returns true if field startKeyInclusive is set (has been assigned a value) and false otherwise */
292   public boolean isSetStartKeyInclusive() {
293     return EncodingUtils.testBit(__isset_bitfield, __STARTKEYINCLUSIVE_ISSET_ID);
294   }
295 
296   public void setStartKeyInclusiveIsSet(boolean value) {
297     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTKEYINCLUSIVE_ISSET_ID, value);
298   }
299 
300   public boolean isStopKeyInclusive() {
301     return this.stopKeyInclusive;
302   }
303 
304   public TRange setStopKeyInclusive(boolean stopKeyInclusive) {
305     this.stopKeyInclusive = stopKeyInclusive;
306     setStopKeyInclusiveIsSet(true);
307     return this;
308   }
309 
310   public void unsetStopKeyInclusive() {
311     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STOPKEYINCLUSIVE_ISSET_ID);
312   }
313 
314   /** Returns true if field stopKeyInclusive is set (has been assigned a value) and false otherwise */
315   public boolean isSetStopKeyInclusive() {
316     return EncodingUtils.testBit(__isset_bitfield, __STOPKEYINCLUSIVE_ISSET_ID);
317   }
318 
319   public void setStopKeyInclusiveIsSet(boolean value) {
320     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STOPKEYINCLUSIVE_ISSET_ID, value);
321   }
322 
323   public boolean isInfiniteStartKey() {
324     return this.infiniteStartKey;
325   }
326 
327   public TRange setInfiniteStartKey(boolean infiniteStartKey) {
328     this.infiniteStartKey = infiniteStartKey;
329     setInfiniteStartKeyIsSet(true);
330     return this;
331   }
332 
333   public void unsetInfiniteStartKey() {
334     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INFINITESTARTKEY_ISSET_ID);
335   }
336 
337   /** Returns true if field infiniteStartKey is set (has been assigned a value) and false otherwise */
338   public boolean isSetInfiniteStartKey() {
339     return EncodingUtils.testBit(__isset_bitfield, __INFINITESTARTKEY_ISSET_ID);
340   }
341 
342   public void setInfiniteStartKeyIsSet(boolean value) {
343     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INFINITESTARTKEY_ISSET_ID, value);
344   }
345 
346   public boolean isInfiniteStopKey() {
347     return this.infiniteStopKey;
348   }
349 
350   public TRange setInfiniteStopKey(boolean infiniteStopKey) {
351     this.infiniteStopKey = infiniteStopKey;
352     setInfiniteStopKeyIsSet(true);
353     return this;
354   }
355 
356   public void unsetInfiniteStopKey() {
357     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INFINITESTOPKEY_ISSET_ID);
358   }
359 
360   /** Returns true if field infiniteStopKey is set (has been assigned a value) and false otherwise */
361   public boolean isSetInfiniteStopKey() {
362     return EncodingUtils.testBit(__isset_bitfield, __INFINITESTOPKEY_ISSET_ID);
363   }
364 
365   public void setInfiniteStopKeyIsSet(boolean value) {
366     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INFINITESTOPKEY_ISSET_ID, value);
367   }
368 
369   public void setFieldValue(_Fields field, Object value) {
370     switch (field) {
371     case START:
372       if (value == null) {
373         unsetStart();
374       } else {
375         setStart((TKey)value);
376       }
377       break;
378 
379     case STOP:
380       if (value == null) {
381         unsetStop();
382       } else {
383         setStop((TKey)value);
384       }
385       break;
386 
387     case START_KEY_INCLUSIVE:
388       if (value == null) {
389         unsetStartKeyInclusive();
390       } else {
391         setStartKeyInclusive((Boolean)value);
392       }
393       break;
394 
395     case STOP_KEY_INCLUSIVE:
396       if (value == null) {
397         unsetStopKeyInclusive();
398       } else {
399         setStopKeyInclusive((Boolean)value);
400       }
401       break;
402 
403     case INFINITE_START_KEY:
404       if (value == null) {
405         unsetInfiniteStartKey();
406       } else {
407         setInfiniteStartKey((Boolean)value);
408       }
409       break;
410 
411     case INFINITE_STOP_KEY:
412       if (value == null) {
413         unsetInfiniteStopKey();
414       } else {
415         setInfiniteStopKey((Boolean)value);
416       }
417       break;
418 
419     }
420   }
421 
422   public Object getFieldValue(_Fields field) {
423     switch (field) {
424     case START:
425       return getStart();
426 
427     case STOP:
428       return getStop();
429 
430     case START_KEY_INCLUSIVE:
431       return Boolean.valueOf(isStartKeyInclusive());
432 
433     case STOP_KEY_INCLUSIVE:
434       return Boolean.valueOf(isStopKeyInclusive());
435 
436     case INFINITE_START_KEY:
437       return Boolean.valueOf(isInfiniteStartKey());
438 
439     case INFINITE_STOP_KEY:
440       return Boolean.valueOf(isInfiniteStopKey());
441 
442     }
443     throw new IllegalStateException();
444   }
445 
446   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
447   public boolean isSet(_Fields field) {
448     if (field == null) {
449       throw new IllegalArgumentException();
450     }
451 
452     switch (field) {
453     case START:
454       return isSetStart();
455     case STOP:
456       return isSetStop();
457     case START_KEY_INCLUSIVE:
458       return isSetStartKeyInclusive();
459     case STOP_KEY_INCLUSIVE:
460       return isSetStopKeyInclusive();
461     case INFINITE_START_KEY:
462       return isSetInfiniteStartKey();
463     case INFINITE_STOP_KEY:
464       return isSetInfiniteStopKey();
465     }
466     throw new IllegalStateException();
467   }
468 
469   @Override
470   public boolean equals(Object that) {
471     if (that == null)
472       return false;
473     if (that instanceof TRange)
474       return this.equals((TRange)that);
475     return false;
476   }
477 
478   public boolean equals(TRange that) {
479     if (that == null)
480       return false;
481 
482     boolean this_present_start = true && this.isSetStart();
483     boolean that_present_start = true && that.isSetStart();
484     if (this_present_start || that_present_start) {
485       if (!(this_present_start && that_present_start))
486         return false;
487       if (!this.start.equals(that.start))
488         return false;
489     }
490 
491     boolean this_present_stop = true && this.isSetStop();
492     boolean that_present_stop = true && that.isSetStop();
493     if (this_present_stop || that_present_stop) {
494       if (!(this_present_stop && that_present_stop))
495         return false;
496       if (!this.stop.equals(that.stop))
497         return false;
498     }
499 
500     boolean this_present_startKeyInclusive = true;
501     boolean that_present_startKeyInclusive = true;
502     if (this_present_startKeyInclusive || that_present_startKeyInclusive) {
503       if (!(this_present_startKeyInclusive && that_present_startKeyInclusive))
504         return false;
505       if (this.startKeyInclusive != that.startKeyInclusive)
506         return false;
507     }
508 
509     boolean this_present_stopKeyInclusive = true;
510     boolean that_present_stopKeyInclusive = true;
511     if (this_present_stopKeyInclusive || that_present_stopKeyInclusive) {
512       if (!(this_present_stopKeyInclusive && that_present_stopKeyInclusive))
513         return false;
514       if (this.stopKeyInclusive != that.stopKeyInclusive)
515         return false;
516     }
517 
518     boolean this_present_infiniteStartKey = true;
519     boolean that_present_infiniteStartKey = true;
520     if (this_present_infiniteStartKey || that_present_infiniteStartKey) {
521       if (!(this_present_infiniteStartKey && that_present_infiniteStartKey))
522         return false;
523       if (this.infiniteStartKey != that.infiniteStartKey)
524         return false;
525     }
526 
527     boolean this_present_infiniteStopKey = true;
528     boolean that_present_infiniteStopKey = true;
529     if (this_present_infiniteStopKey || that_present_infiniteStopKey) {
530       if (!(this_present_infiniteStopKey && that_present_infiniteStopKey))
531         return false;
532       if (this.infiniteStopKey != that.infiniteStopKey)
533         return false;
534     }
535 
536     return true;
537   }
538 
539   @Override
540   public int hashCode() {
541     return 0;
542   }
543 
544   public int compareTo(TRange other) {
545     if (!getClass().equals(other.getClass())) {
546       return getClass().getName().compareTo(other.getClass().getName());
547     }
548 
549     int lastComparison = 0;
550     TRange typedOther = (TRange)other;
551 
552     lastComparison = Boolean.valueOf(isSetStart()).compareTo(typedOther.isSetStart());
553     if (lastComparison != 0) {
554       return lastComparison;
555     }
556     if (isSetStart()) {
557       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start, typedOther.start);
558       if (lastComparison != 0) {
559         return lastComparison;
560       }
561     }
562     lastComparison = Boolean.valueOf(isSetStop()).compareTo(typedOther.isSetStop());
563     if (lastComparison != 0) {
564       return lastComparison;
565     }
566     if (isSetStop()) {
567       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stop, typedOther.stop);
568       if (lastComparison != 0) {
569         return lastComparison;
570       }
571     }
572     lastComparison = Boolean.valueOf(isSetStartKeyInclusive()).compareTo(typedOther.isSetStartKeyInclusive());
573     if (lastComparison != 0) {
574       return lastComparison;
575     }
576     if (isSetStartKeyInclusive()) {
577       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKeyInclusive, typedOther.startKeyInclusive);
578       if (lastComparison != 0) {
579         return lastComparison;
580       }
581     }
582     lastComparison = Boolean.valueOf(isSetStopKeyInclusive()).compareTo(typedOther.isSetStopKeyInclusive());
583     if (lastComparison != 0) {
584       return lastComparison;
585     }
586     if (isSetStopKeyInclusive()) {
587       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stopKeyInclusive, typedOther.stopKeyInclusive);
588       if (lastComparison != 0) {
589         return lastComparison;
590       }
591     }
592     lastComparison = Boolean.valueOf(isSetInfiniteStartKey()).compareTo(typedOther.isSetInfiniteStartKey());
593     if (lastComparison != 0) {
594       return lastComparison;
595     }
596     if (isSetInfiniteStartKey()) {
597       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infiniteStartKey, typedOther.infiniteStartKey);
598       if (lastComparison != 0) {
599         return lastComparison;
600       }
601     }
602     lastComparison = Boolean.valueOf(isSetInfiniteStopKey()).compareTo(typedOther.isSetInfiniteStopKey());
603     if (lastComparison != 0) {
604       return lastComparison;
605     }
606     if (isSetInfiniteStopKey()) {
607       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infiniteStopKey, typedOther.infiniteStopKey);
608       if (lastComparison != 0) {
609         return lastComparison;
610       }
611     }
612     return 0;
613   }
614 
615   public _Fields fieldForId(int fieldId) {
616     return _Fields.findByThriftId(fieldId);
617   }
618 
619   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
620     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
621   }
622 
623   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
624     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
625   }
626 
627   @Override
628   public String toString() {
629     StringBuilder sb = new StringBuilder("TRange(");
630     boolean first = true;
631 
632     sb.append("start:");
633     if (this.start == null) {
634       sb.append("null");
635     } else {
636       sb.append(this.start);
637     }
638     first = false;
639     if (!first) sb.append(", ");
640     sb.append("stop:");
641     if (this.stop == null) {
642       sb.append("null");
643     } else {
644       sb.append(this.stop);
645     }
646     first = false;
647     if (!first) sb.append(", ");
648     sb.append("startKeyInclusive:");
649     sb.append(this.startKeyInclusive);
650     first = false;
651     if (!first) sb.append(", ");
652     sb.append("stopKeyInclusive:");
653     sb.append(this.stopKeyInclusive);
654     first = false;
655     if (!first) sb.append(", ");
656     sb.append("infiniteStartKey:");
657     sb.append(this.infiniteStartKey);
658     first = false;
659     if (!first) sb.append(", ");
660     sb.append("infiniteStopKey:");
661     sb.append(this.infiniteStopKey);
662     first = false;
663     sb.append(")");
664     return sb.toString();
665   }
666 
667   public void validate() throws org.apache.thrift.TException {
668     // check for required fields
669     // check for sub-struct validity
670     if (start != null) {
671       start.validate();
672     }
673     if (stop != null) {
674       stop.validate();
675     }
676   }
677 
678   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
679     try {
680       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
681     } catch (org.apache.thrift.TException te) {
682       throw new java.io.IOException(te);
683     }
684   }
685 
686   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
687     try {
688       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
689       __isset_bitfield = 0;
690       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
691     } catch (org.apache.thrift.TException te) {
692       throw new java.io.IOException(te);
693     }
694   }
695 
696   private static class TRangeStandardSchemeFactory implements SchemeFactory {
697     public TRangeStandardScheme getScheme() {
698       return new TRangeStandardScheme();
699     }
700   }
701 
702   private static class TRangeStandardScheme extends StandardScheme<TRange> {
703 
704     public void read(org.apache.thrift.protocol.TProtocol iprot, TRange struct) throws org.apache.thrift.TException {
705       org.apache.thrift.protocol.TField schemeField;
706       iprot.readStructBegin();
707       while (true)
708       {
709         schemeField = iprot.readFieldBegin();
710         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
711           break;
712         }
713         switch (schemeField.id) {
714           case 1: // START
715             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
716               struct.start = new TKey();
717               struct.start.read(iprot);
718               struct.setStartIsSet(true);
719             } else { 
720               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
721             }
722             break;
723           case 2: // STOP
724             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
725               struct.stop = new TKey();
726               struct.stop.read(iprot);
727               struct.setStopIsSet(true);
728             } else { 
729               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
730             }
731             break;
732           case 3: // START_KEY_INCLUSIVE
733             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
734               struct.startKeyInclusive = iprot.readBool();
735               struct.setStartKeyInclusiveIsSet(true);
736             } else { 
737               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
738             }
739             break;
740           case 4: // STOP_KEY_INCLUSIVE
741             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
742               struct.stopKeyInclusive = iprot.readBool();
743               struct.setStopKeyInclusiveIsSet(true);
744             } else { 
745               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
746             }
747             break;
748           case 5: // INFINITE_START_KEY
749             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
750               struct.infiniteStartKey = iprot.readBool();
751               struct.setInfiniteStartKeyIsSet(true);
752             } else { 
753               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
754             }
755             break;
756           case 6: // INFINITE_STOP_KEY
757             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
758               struct.infiniteStopKey = iprot.readBool();
759               struct.setInfiniteStopKeyIsSet(true);
760             } else { 
761               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
762             }
763             break;
764           default:
765             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
766         }
767         iprot.readFieldEnd();
768       }
769       iprot.readStructEnd();
770 
771       // check for required fields of primitive type, which can't be checked in the validate method
772       struct.validate();
773     }
774 
775     public void write(org.apache.thrift.protocol.TProtocol oprot, TRange struct) throws org.apache.thrift.TException {
776       struct.validate();
777 
778       oprot.writeStructBegin(STRUCT_DESC);
779       if (struct.start != null) {
780         oprot.writeFieldBegin(START_FIELD_DESC);
781         struct.start.write(oprot);
782         oprot.writeFieldEnd();
783       }
784       if (struct.stop != null) {
785         oprot.writeFieldBegin(STOP_FIELD_DESC);
786         struct.stop.write(oprot);
787         oprot.writeFieldEnd();
788       }
789       oprot.writeFieldBegin(START_KEY_INCLUSIVE_FIELD_DESC);
790       oprot.writeBool(struct.startKeyInclusive);
791       oprot.writeFieldEnd();
792       oprot.writeFieldBegin(STOP_KEY_INCLUSIVE_FIELD_DESC);
793       oprot.writeBool(struct.stopKeyInclusive);
794       oprot.writeFieldEnd();
795       oprot.writeFieldBegin(INFINITE_START_KEY_FIELD_DESC);
796       oprot.writeBool(struct.infiniteStartKey);
797       oprot.writeFieldEnd();
798       oprot.writeFieldBegin(INFINITE_STOP_KEY_FIELD_DESC);
799       oprot.writeBool(struct.infiniteStopKey);
800       oprot.writeFieldEnd();
801       oprot.writeFieldStop();
802       oprot.writeStructEnd();
803     }
804 
805   }
806 
807   private static class TRangeTupleSchemeFactory implements SchemeFactory {
808     public TRangeTupleScheme getScheme() {
809       return new TRangeTupleScheme();
810     }
811   }
812 
813   private static class TRangeTupleScheme extends TupleScheme<TRange> {
814 
815     @Override
816     public void write(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
817       TTupleProtocol oprot = (TTupleProtocol) prot;
818       BitSet optionals = new BitSet();
819       if (struct.isSetStart()) {
820         optionals.set(0);
821       }
822       if (struct.isSetStop()) {
823         optionals.set(1);
824       }
825       if (struct.isSetStartKeyInclusive()) {
826         optionals.set(2);
827       }
828       if (struct.isSetStopKeyInclusive()) {
829         optionals.set(3);
830       }
831       if (struct.isSetInfiniteStartKey()) {
832         optionals.set(4);
833       }
834       if (struct.isSetInfiniteStopKey()) {
835         optionals.set(5);
836       }
837       oprot.writeBitSet(optionals, 6);
838       if (struct.isSetStart()) {
839         struct.start.write(oprot);
840       }
841       if (struct.isSetStop()) {
842         struct.stop.write(oprot);
843       }
844       if (struct.isSetStartKeyInclusive()) {
845         oprot.writeBool(struct.startKeyInclusive);
846       }
847       if (struct.isSetStopKeyInclusive()) {
848         oprot.writeBool(struct.stopKeyInclusive);
849       }
850       if (struct.isSetInfiniteStartKey()) {
851         oprot.writeBool(struct.infiniteStartKey);
852       }
853       if (struct.isSetInfiniteStopKey()) {
854         oprot.writeBool(struct.infiniteStopKey);
855       }
856     }
857 
858     @Override
859     public void read(org.apache.thrift.protocol.TProtocol prot, TRange struct) throws org.apache.thrift.TException {
860       TTupleProtocol iprot = (TTupleProtocol) prot;
861       BitSet incoming = iprot.readBitSet(6);
862       if (incoming.get(0)) {
863         struct.start = new TKey();
864         struct.start.read(iprot);
865         struct.setStartIsSet(true);
866       }
867       if (incoming.get(1)) {
868         struct.stop = new TKey();
869         struct.stop.read(iprot);
870         struct.setStopIsSet(true);
871       }
872       if (incoming.get(2)) {
873         struct.startKeyInclusive = iprot.readBool();
874         struct.setStartKeyInclusiveIsSet(true);
875       }
876       if (incoming.get(3)) {
877         struct.stopKeyInclusive = iprot.readBool();
878         struct.setStopKeyInclusiveIsSet(true);
879       }
880       if (incoming.get(4)) {
881         struct.infiniteStartKey = iprot.readBool();
882         struct.setInfiniteStartKeyIsSet(true);
883       }
884       if (incoming.get(5)) {
885         struct.infiniteStopKey = iprot.readBool();
886         struct.setInfiniteStopKeyIsSet(true);
887       }
888     }
889   }
890 
891 }
892