Пример #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, tokenize_result struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(1);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TList _list10 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.LIST, iprot.readI32());
       struct.success = new ArrayList<List<String>>(_list10.size);
       for (int _i11 = 0; _i11 < _list10.size; ++_i11) {
         List<String> _elem12;
         {
           org.apache.thrift.protocol.TList _list13 =
               new org.apache.thrift.protocol.TList(
                   org.apache.thrift.protocol.TType.STRING, iprot.readI32());
           _elem12 = new ArrayList<String>(_list13.size);
           for (int _i14 = 0; _i14 < _list13.size; ++_i14) {
             String _elem15;
             _elem15 = iprot.readString();
             _elem12.add(_elem15);
           }
         }
         struct.success.add(_elem12);
       }
     }
     struct.setSuccessIsSet(true);
   }
 }
Пример #2
0
      public void read(org.apache.thrift.protocol.TProtocol iprot, tokenize_result 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 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
                {
                  org.apache.thrift.protocol.TList _list0 = iprot.readListBegin();
                  struct.success = new ArrayList<List<String>>(_list0.size);
                  for (int _i1 = 0; _i1 < _list0.size; ++_i1) {
                    List<String> _elem2;
                    {
                      org.apache.thrift.protocol.TList _list3 = iprot.readListBegin();
                      _elem2 = new ArrayList<String>(_list3.size);
                      for (int _i4 = 0; _i4 < _list3.size; ++_i4) {
                        String _elem5;
                        _elem5 = iprot.readString();
                        _elem2.add(_elem5);
                      }
                      iprot.readListEnd();
                    }
                    struct.success.add(_elem2);
                  }
                  iprot.readListEnd();
                }
                struct.setSuccessIsSet(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();
      }