Ejemplo 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;
  }
Ejemplo n.º 2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, LockBlockResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.lockId = iprot.readI64();
     struct.setLockIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.blockPath = iprot.readString();
     struct.setBlockPathIsSet(true);
   }
 }
Ejemplo n.º 3
0
 /** Performs a deep copy on <i>other</i>. */
 public LockBlockResult(LockBlockResult other) {
   __isset_bitfield = other.__isset_bitfield;
   this.lockId = other.lockId;
   if (other.isSetBlockPath()) {
     this.blockPath = other.blockPath;
   }
 }
Ejemplo n.º 4
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);
   }
 }
Ejemplo n.º 5
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, LockBlockResult 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: // LOCK_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.lockId = iprot.readI64();
              struct.setLockIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // BLOCK_PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.blockPath = iprot.readString();
              struct.setBlockPathIsSet(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();
    }
Ejemplo n.º 6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, LockBlockResult struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(LOCK_ID_FIELD_DESC);
      oprot.writeI64(struct.lockId);
      oprot.writeFieldEnd();
      if (struct.blockPath != null) {
        oprot.writeFieldBegin(BLOCK_PATH_FIELD_DESC);
        oprot.writeString(struct.blockPath);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 7
0
  public boolean equals(LockBlockResult that) {
    if (that == null) return false;

    boolean this_present_lockId = true;
    boolean that_present_lockId = true;
    if (this_present_lockId || that_present_lockId) {
      if (!(this_present_lockId && that_present_lockId)) return false;
      if (this.lockId != that.lockId) return false;
    }

    boolean this_present_blockPath = true && this.isSetBlockPath();
    boolean that_present_blockPath = true && that.isSetBlockPath();
    if (this_present_blockPath || that_present_blockPath) {
      if (!(this_present_blockPath && that_present_blockPath)) return false;
      if (!this.blockPath.equals(that.blockPath)) return false;
    }

    return true;
  }