Exemplo n.º 1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, QueryFListResult struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.result != null) {
        oprot.writeFieldBegin(RESULT_FIELD_DESC);
        struct.result.write(oprot);
        oprot.writeFieldEnd();
      }
      if (struct.files != null) {
        if (struct.isSetFiles()) {
          oprot.writeFieldBegin(FILES_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.STRUCT, struct.files.size()));
            for (FileInfo _iter3 : struct.files) {
              _iter3.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSpare()) {
        oprot.writeFieldBegin(SPARE_FIELD_DESC);
        oprot.writeI32(struct.spare);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Exemplo n.º 2
0
  public boolean equals(QueryFListResult that) {
    if (that == null) return false;

    boolean this_present_result = true && this.isSetResult();
    boolean that_present_result = true && that.isSetResult();
    if (this_present_result || that_present_result) {
      if (!(this_present_result && that_present_result)) return false;
      if (!this.result.equals(that.result)) return false;
    }

    boolean this_present_files = true && this.isSetFiles();
    boolean that_present_files = true && that.isSetFiles();
    if (this_present_files || that_present_files) {
      if (!(this_present_files && that_present_files)) return false;
      if (!this.files.equals(that.files)) return false;
    }

    boolean this_present_spare = true && this.isSetSpare();
    boolean that_present_spare = true && that.isSetSpare();
    if (this_present_spare || that_present_spare) {
      if (!(this_present_spare && that_present_spare)) return false;
      if (this.spare != that.spare) return false;
    }

    return true;
  }
Exemplo n.º 3
0
 /** Performs a deep copy on <i>other</i>. */
 public QueryFListResult(QueryFListResult other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetResult()) {
     this.result = new RetHead(other.result);
   }
   if (other.isSetFiles()) {
     this.files = other.files;
   }
   this.spare = other.spare;
 }
Exemplo n.º 4
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, QueryFListResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.result = new RetHead();
     struct.result.read(iprot);
     struct.setResultIsSet(true);
   }
   if (incoming.get(1)) {
     {
       org.apache.thrift.protocol.TList _list5 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.files = new ArrayList<FileInfo>(_list5.size);
       FileInfo _elem6;
       for (int _i7 = 0; _i7 < _list5.size; ++_i7) {
         _elem6 = new FileInfo();
         _elem6.read(iprot);
         struct.files.add(_elem6);
       }
     }
     struct.setFilesIsSet(true);
   }
   if (incoming.get(2)) {
     struct.spare = iprot.readI32();
     struct.setSpareIsSet(true);
   }
 }
Exemplo n.º 5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, QueryFListResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetResult()) {
     optionals.set(0);
   }
   if (struct.isSetFiles()) {
     optionals.set(1);
   }
   if (struct.isSetSpare()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetResult()) {
     struct.result.write(oprot);
   }
   if (struct.isSetFiles()) {
     {
       oprot.writeI32(struct.files.size());
       for (FileInfo _iter4 : struct.files) {
         _iter4.write(oprot);
       }
     }
   }
   if (struct.isSetSpare()) {
     oprot.writeI32(struct.spare);
   }
 }
Exemplo n.º 6
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, QueryFListResult 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: // RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.result = new RetHead();
              struct.result.read(iprot);
              struct.setResultIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FILES
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                struct.files = new ArrayList<FileInfo>(_list0.size);
                FileInfo _elem1;
                for (int _i2 = 0; _i2 < _list0.size; ++_i2) {
                  _elem1 = new FileInfo();
                  _elem1.read(iprot);
                  struct.files.add(_elem1);
                }
                iprot.readListEnd();
              }
              struct.setFilesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SPARE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.spare = iprot.readI32();
              struct.setSpareIsSet(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();
    }
Exemplo n.º 7
0
  @Override
  public int compareTo(QueryFListResult other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetResult()).compareTo(other.isSetResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, other.result);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFiles()).compareTo(other.isSetFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFiles()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.files, other.files);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSpare()).compareTo(other.isSetSpare());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSpare()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.spare, other.spare);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }