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
  @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;
  }