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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetLockId()).compareTo(other.isSetLockId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLockId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lockId, other.lockId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBlockPath()).compareTo(other.isSetBlockPath());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlockPath()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockPath, other.blockPath);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemplo n.º 2
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, LockBlockResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetLockId()) {
     optionals.set(0);
   }
   if (struct.isSetBlockPath()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetLockId()) {
     oprot.writeI64(struct.lockId);
   }
   if (struct.isSetBlockPath()) {
     oprot.writeString(struct.blockPath);
   }
 }