Пример #1
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);
   }
 }
Пример #2
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();
    }