Example #1
0
      public void write(org.apache.thrift.protocol.TProtocol oprot, tokenize_result struct)
          throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          {
            oprot.writeListBegin(
                new org.apache.thrift.protocol.TList(
                    org.apache.thrift.protocol.TType.LIST, struct.success.size()));
            for (List<String> _iter6 : struct.success) {
              {
                oprot.writeListBegin(
                    new org.apache.thrift.protocol.TList(
                        org.apache.thrift.protocol.TType.STRING, _iter6.size()));
                for (String _iter7 : _iter6) {
                  oprot.writeString(_iter7);
                }
                oprot.writeListEnd();
              }
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }
Example #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();
      }