Exemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TRange struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetStart()) {
     optionals.set(0);
   }
   if (struct.isSetStop()) {
     optionals.set(1);
   }
   if (struct.isSetStartKeyInclusive()) {
     optionals.set(2);
   }
   if (struct.isSetStopKeyInclusive()) {
     optionals.set(3);
   }
   if (struct.isSetInfiniteStartKey()) {
     optionals.set(4);
   }
   if (struct.isSetInfiniteStopKey()) {
     optionals.set(5);
   }
   oprot.writeBitSet(optionals, 6);
   if (struct.isSetStart()) {
     struct.start.write(oprot);
   }
   if (struct.isSetStop()) {
     struct.stop.write(oprot);
   }
   if (struct.isSetStartKeyInclusive()) {
     oprot.writeBool(struct.startKeyInclusive);
   }
   if (struct.isSetStopKeyInclusive()) {
     oprot.writeBool(struct.stopKeyInclusive);
   }
   if (struct.isSetInfiniteStartKey()) {
     oprot.writeBool(struct.infiniteStartKey);
   }
   if (struct.isSetInfiniteStopKey()) {
     oprot.writeBool(struct.infiniteStopKey);
   }
 }
Exemplo n.º 2
0
 /** Performs a deep copy on <i>other</i>. */
 public TRange(TRange other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetStart()) {
     this.start = new TKey(other.start);
   }
   if (other.isSetStop()) {
     this.stop = new TKey(other.stop);
   }
   this.startKeyInclusive = other.startKeyInclusive;
   this.stopKeyInclusive = other.stopKeyInclusive;
   this.infiniteStartKey = other.infiniteStartKey;
   this.infiniteStopKey = other.infiniteStopKey;
 }
Exemplo n.º 3
0
  public boolean equals(TRange that) {
    if (that == null) return false;

    boolean this_present_start = true && this.isSetStart();
    boolean that_present_start = true && that.isSetStart();
    if (this_present_start || that_present_start) {
      if (!(this_present_start && that_present_start)) return false;
      if (!this.start.equals(that.start)) return false;
    }

    boolean this_present_stop = true && this.isSetStop();
    boolean that_present_stop = true && that.isSetStop();
    if (this_present_stop || that_present_stop) {
      if (!(this_present_stop && that_present_stop)) return false;
      if (!this.stop.equals(that.stop)) return false;
    }

    boolean this_present_startKeyInclusive = true;
    boolean that_present_startKeyInclusive = true;
    if (this_present_startKeyInclusive || that_present_startKeyInclusive) {
      if (!(this_present_startKeyInclusive && that_present_startKeyInclusive)) return false;
      if (this.startKeyInclusive != that.startKeyInclusive) return false;
    }

    boolean this_present_stopKeyInclusive = true;
    boolean that_present_stopKeyInclusive = true;
    if (this_present_stopKeyInclusive || that_present_stopKeyInclusive) {
      if (!(this_present_stopKeyInclusive && that_present_stopKeyInclusive)) return false;
      if (this.stopKeyInclusive != that.stopKeyInclusive) return false;
    }

    boolean this_present_infiniteStartKey = true;
    boolean that_present_infiniteStartKey = true;
    if (this_present_infiniteStartKey || that_present_infiniteStartKey) {
      if (!(this_present_infiniteStartKey && that_present_infiniteStartKey)) return false;
      if (this.infiniteStartKey != that.infiniteStartKey) return false;
    }

    boolean this_present_infiniteStopKey = true;
    boolean that_present_infiniteStopKey = true;
    if (this_present_infiniteStopKey || that_present_infiniteStopKey) {
      if (!(this_present_infiniteStopKey && that_present_infiniteStopKey)) return false;
      if (this.infiniteStopKey != that.infiniteStopKey) return false;
    }

    return true;
  }
Exemplo n.º 4
0
  @Override
  public int compareTo(TRange other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetStart()).compareTo(other.isSetStart());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStart()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start, other.start);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStop()).compareTo(other.isSetStop());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStop()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stop, other.stop);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetStartKeyInclusive()).compareTo(other.isSetStartKeyInclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStartKeyInclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.startKeyInclusive, other.startKeyInclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetStopKeyInclusive()).compareTo(other.isSetStopKeyInclusive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStopKeyInclusive()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.stopKeyInclusive, other.stopKeyInclusive);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetInfiniteStartKey()).compareTo(other.isSetInfiniteStartKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInfiniteStartKey()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.infiniteStartKey, other.infiniteStartKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetInfiniteStopKey()).compareTo(other.isSetInfiniteStopKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInfiniteStopKey()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.infiniteStopKey, other.infiniteStopKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }