Пример #1
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;
 }
Пример #2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TRange struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.start != null) {
        oprot.writeFieldBegin(START_FIELD_DESC);
        struct.start.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.stop != null) {
        oprot.writeFieldBegin(STOP_FIELD_DESC);
        struct.stop.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(START_KEY_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.startKeyInclusive);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(STOP_KEY_INCLUSIVE_FIELD_DESC);
      oprot.writeBool(struct.stopKeyInclusive);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INFINITE_START_KEY_FIELD_DESC);
      oprot.writeBool(struct.infiniteStartKey);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INFINITE_STOP_KEY_FIELD_DESC);
      oprot.writeBool(struct.infiniteStopKey);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Пример #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;
  }
Пример #4
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TRange struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.start = new TKey();
     struct.start.read(iprot);
     struct.setStartIsSet(true);
   }
   if (incoming.get(1)) {
     struct.stop = new TKey();
     struct.stop.read(iprot);
     struct.setStopIsSet(true);
   }
   if (incoming.get(2)) {
     struct.startKeyInclusive = iprot.readBool();
     struct.setStartKeyInclusiveIsSet(true);
   }
   if (incoming.get(3)) {
     struct.stopKeyInclusive = iprot.readBool();
     struct.setStopKeyInclusiveIsSet(true);
   }
   if (incoming.get(4)) {
     struct.infiniteStartKey = iprot.readBool();
     struct.setInfiniteStartKeyIsSet(true);
   }
   if (incoming.get(5)) {
     struct.infiniteStopKey = iprot.readBool();
     struct.setInfiniteStopKeyIsSet(true);
   }
 }
Пример #5
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);
   }
 }
Пример #6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TRange struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // START
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.start = new TKey();
              struct.start.read(iprot);
              struct.setStartIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // STOP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.stop = new TKey();
              struct.stop.read(iprot);
              struct.setStopIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // START_KEY_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.startKeyInclusive = iprot.readBool();
              struct.setStartKeyInclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STOP_KEY_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.stopKeyInclusive = iprot.readBool();
              struct.setStopKeyInclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // INFINITE_START_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.infiniteStartKey = iprot.readBool();
              struct.setInfiniteStartKeyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // INFINITE_STOP_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.infiniteStopKey = iprot.readBool();
              struct.setInfiniteStopKeyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
Пример #7
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;
  }