コード例 #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, InteractionTask struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(9);
   if (incoming.get(0)) {
     struct.iid = iprot.readI32();
     struct.setIidIsSet(true);
   }
   if (incoming.get(1)) {
     struct.input = Input.findByValue(iprot.readI32());
     struct.setInputIsSet(true);
   }
   if (incoming.get(2)) {
     {
       org.apache.thrift.protocol.TList _list39 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRING, iprot.readI32());
       struct.structure = new ArrayList<String>(_list39.size);
       for (int _i40 = 0; _i40 < _list39.size; ++_i40) {
         String _elem41; // required
         _elem41 = iprot.readString();
         struct.structure.add(_elem41);
       }
     }
     struct.setStructureIsSet(true);
   }
   if (incoming.get(3)) {
     {
       org.apache.thrift.protocol.TList _list42 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRING, iprot.readI32());
       struct.preset = new ArrayList<String>(_list42.size);
       for (int _i43 = 0; _i43 < _list42.size; ++_i43) {
         String _elem44; // required
         _elem44 = iprot.readString();
         struct.preset.add(_elem44);
       }
     }
     struct.setPresetIsSet(true);
   }
   if (incoming.get(4)) {
     struct.output = Output.findByValue(iprot.readI32());
     struct.setOutputIsSet(true);
   }
   if (incoming.get(5)) {
     {
       org.apache.thrift.protocol.TList _list45 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRING, iprot.readI32());
       struct.data = new ArrayList<String>(_list45.size);
       for (int _i46 = 0; _i46 < _list45.size; ++_i46) {
         String _elem47; // required
         _elem47 = iprot.readString();
         struct.data.add(_elem47);
       }
     }
     struct.setDataIsSet(true);
   }
   if (incoming.get(6)) {
     struct.title = iprot.readString();
     struct.setTitleIsSet(true);
   }
   if (incoming.get(7)) {
     struct.description = iprot.readString();
     struct.setDescriptionIsSet(true);
   }
   if (incoming.get(8)) {
     struct.plugin = iprot.readString();
     struct.setPluginIsSet(true);
   }
 }
コード例 #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, InteractionTask 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: // IID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.iid = iprot.readI32();
              struct.setIidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // INPUT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.input = Input.findByValue(iprot.readI32());
              struct.setInputIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // STRUCTURE
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list24 = iprot.readListBegin();
                struct.structure = new ArrayList<String>(_list24.size);
                for (int _i25 = 0; _i25 < _list24.size; ++_i25) {
                  String _elem26; // required
                  _elem26 = iprot.readString();
                  struct.structure.add(_elem26);
                }
                iprot.readListEnd();
              }
              struct.setStructureIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // PRESET
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list27 = iprot.readListBegin();
                struct.preset = new ArrayList<String>(_list27.size);
                for (int _i28 = 0; _i28 < _list27.size; ++_i28) {
                  String _elem29; // required
                  _elem29 = iprot.readString();
                  struct.preset.add(_elem29);
                }
                iprot.readListEnd();
              }
              struct.setPresetIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // OUTPUT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.output = Output.findByValue(iprot.readI32());
              struct.setOutputIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // DATA
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list30 = iprot.readListBegin();
                struct.data = new ArrayList<String>(_list30.size);
                for (int _i31 = 0; _i31 < _list30.size; ++_i31) {
                  String _elem32; // required
                  _elem32 = iprot.readString();
                  struct.data.add(_elem32);
                }
                iprot.readListEnd();
              }
              struct.setDataIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TITLE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.title = iprot.readString();
              struct.setTitleIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // DESCRIPTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.description = iprot.readString();
              struct.setDescriptionIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // PLUGIN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.plugin = iprot.readString();
              struct.setPluginIsSet(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();
    }