예제 #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, UserCrawlState struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetUid()) {
     optionals.set(0);
   }
   if (struct.isSetSinceID()) {
     optionals.set(1);
   }
   if (struct.isSetLastCrawlTime()) {
     optionals.set(2);
   }
   if (struct.isSetLastCrawlNum()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetUid()) {
     oprot.writeString(struct.uid);
   }
   if (struct.isSetSinceID()) {
     oprot.writeI64(struct.sinceID);
   }
   if (struct.isSetLastCrawlTime()) {
     oprot.writeI64(struct.lastCrawlTime);
   }
   if (struct.isSetLastCrawlNum()) {
     oprot.writeI16(struct.lastCrawlNum);
   }
 }
예제 #2
0
  @Override
  public int compareTo(UserCrawlState other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetUid()).compareTo(other.isSetUid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uid, other.uid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSinceID()).compareTo(other.isSetSinceID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSinceID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sinceID, other.sinceID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCrawlTime()).compareTo(other.isSetLastCrawlTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCrawlTime()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastCrawlTime, other.lastCrawlTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastCrawlNum()).compareTo(other.isSetLastCrawlNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastCrawlNum()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.lastCrawlNum, other.lastCrawlNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }