コード例 #1
0
 /** Performs a deep copy on <i>other</i>. */
 public InteractionTask(InteractionTask other) {
   __isset_bitfield = other.__isset_bitfield;
   this.iid = other.iid;
   if (other.isSetInput()) {
     this.input = other.input;
   }
   if (other.isSetStructure()) {
     List<String> __this__structure = new ArrayList<String>();
     for (String other_element : other.structure) {
       __this__structure.add(other_element);
     }
     this.structure = __this__structure;
   }
   if (other.isSetPreset()) {
     List<String> __this__preset = new ArrayList<String>();
     for (String other_element : other.preset) {
       __this__preset.add(other_element);
     }
     this.preset = __this__preset;
   }
   if (other.isSetOutput()) {
     this.output = other.output;
   }
   if (other.isSetData()) {
     List<String> __this__data = new ArrayList<String>();
     for (String other_element : other.data) {
       __this__data.add(other_element);
     }
     this.data = __this__data;
   }
   if (other.isSetTitle()) {
     this.title = other.title;
   }
   if (other.isSetDescription()) {
     this.description = other.description;
   }
   if (other.isSetPlugin()) {
     this.plugin = other.plugin;
   }
 }
コード例 #2
0
  public int compareTo(InteractionTask other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    InteractionTask typedOther = (InteractionTask) other;

    lastComparison = Boolean.valueOf(isSetIid()).compareTo(typedOther.isSetIid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iid, typedOther.iid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInput()).compareTo(typedOther.isSetInput());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInput()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.input, typedOther.input);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStructure()).compareTo(typedOther.isSetStructure());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStructure()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.structure, typedOther.structure);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPreset()).compareTo(typedOther.isSetPreset());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPreset()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.preset, typedOther.preset);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetOutput()).compareTo(typedOther.isSetOutput());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOutput()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.output, typedOther.output);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetData()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTitle()).compareTo(typedOther.isSetTitle());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTitle()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.title, typedOther.title);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDescription()).compareTo(typedOther.isSetDescription());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDescription()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.description, typedOther.description);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPlugin()).compareTo(typedOther.isSetPlugin());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPlugin()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.plugin, typedOther.plugin);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
コード例 #3
0
  public boolean equals(InteractionTask that) {
    if (that == null) return false;

    boolean this_present_iid = true;
    boolean that_present_iid = true;
    if (this_present_iid || that_present_iid) {
      if (!(this_present_iid && that_present_iid)) return false;
      if (this.iid != that.iid) return false;
    }

    boolean this_present_input = true && this.isSetInput();
    boolean that_present_input = true && that.isSetInput();
    if (this_present_input || that_present_input) {
      if (!(this_present_input && that_present_input)) return false;
      if (!this.input.equals(that.input)) return false;
    }

    boolean this_present_structure = true && this.isSetStructure();
    boolean that_present_structure = true && that.isSetStructure();
    if (this_present_structure || that_present_structure) {
      if (!(this_present_structure && that_present_structure)) return false;
      if (!this.structure.equals(that.structure)) return false;
    }

    boolean this_present_preset = true && this.isSetPreset();
    boolean that_present_preset = true && that.isSetPreset();
    if (this_present_preset || that_present_preset) {
      if (!(this_present_preset && that_present_preset)) return false;
      if (!this.preset.equals(that.preset)) return false;
    }

    boolean this_present_output = true && this.isSetOutput();
    boolean that_present_output = true && that.isSetOutput();
    if (this_present_output || that_present_output) {
      if (!(this_present_output && that_present_output)) return false;
      if (!this.output.equals(that.output)) return false;
    }

    boolean this_present_data = true && this.isSetData();
    boolean that_present_data = true && that.isSetData();
    if (this_present_data || that_present_data) {
      if (!(this_present_data && that_present_data)) return false;
      if (!this.data.equals(that.data)) return false;
    }

    boolean this_present_title = true && this.isSetTitle();
    boolean that_present_title = true && that.isSetTitle();
    if (this_present_title || that_present_title) {
      if (!(this_present_title && that_present_title)) return false;
      if (!this.title.equals(that.title)) return false;
    }

    boolean this_present_description = true && this.isSetDescription();
    boolean that_present_description = true && that.isSetDescription();
    if (this_present_description || that_present_description) {
      if (!(this_present_description && that_present_description)) return false;
      if (!this.description.equals(that.description)) return false;
    }

    boolean this_present_plugin = true && this.isSetPlugin();
    boolean that_present_plugin = true && that.isSetPlugin();
    if (this_present_plugin || that_present_plugin) {
      if (!(this_present_plugin && that_present_plugin)) return false;
      if (!this.plugin.equals(that.plugin)) return false;
    }

    return true;
  }
コード例 #4
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);
   }
 }
コード例 #5
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, InteractionTask struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetIid()) {
     optionals.set(0);
   }
   if (struct.isSetInput()) {
     optionals.set(1);
   }
   if (struct.isSetStructure()) {
     optionals.set(2);
   }
   if (struct.isSetPreset()) {
     optionals.set(3);
   }
   if (struct.isSetOutput()) {
     optionals.set(4);
   }
   if (struct.isSetData()) {
     optionals.set(5);
   }
   if (struct.isSetTitle()) {
     optionals.set(6);
   }
   if (struct.isSetDescription()) {
     optionals.set(7);
   }
   if (struct.isSetPlugin()) {
     optionals.set(8);
   }
   oprot.writeBitSet(optionals, 9);
   if (struct.isSetIid()) {
     oprot.writeI32(struct.iid);
   }
   if (struct.isSetInput()) {
     oprot.writeI32(struct.input.getValue());
   }
   if (struct.isSetStructure()) {
     {
       oprot.writeI32(struct.structure.size());
       for (String _iter36 : struct.structure) {
         oprot.writeString(_iter36);
       }
     }
   }
   if (struct.isSetPreset()) {
     {
       oprot.writeI32(struct.preset.size());
       for (String _iter37 : struct.preset) {
         oprot.writeString(_iter37);
       }
     }
   }
   if (struct.isSetOutput()) {
     oprot.writeI32(struct.output.getValue());
   }
   if (struct.isSetData()) {
     {
       oprot.writeI32(struct.data.size());
       for (String _iter38 : struct.data) {
         oprot.writeString(_iter38);
       }
     }
   }
   if (struct.isSetTitle()) {
     oprot.writeString(struct.title);
   }
   if (struct.isSetDescription()) {
     oprot.writeString(struct.description);
   }
   if (struct.isSetPlugin()) {
     oprot.writeString(struct.plugin);
   }
 }
コード例 #6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, InteractionTask struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(IID_FIELD_DESC);
      oprot.writeI32(struct.iid);
      oprot.writeFieldEnd();
      if (struct.input != null) {
        oprot.writeFieldBegin(INPUT_FIELD_DESC);
        oprot.writeI32(struct.input.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.structure != null) {
        oprot.writeFieldBegin(STRUCTURE_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRING, struct.structure.size()));
          for (String _iter33 : struct.structure) {
            oprot.writeString(_iter33);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.preset != null) {
        oprot.writeFieldBegin(PRESET_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRING, struct.preset.size()));
          for (String _iter34 : struct.preset) {
            oprot.writeString(_iter34);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.output != null) {
        oprot.writeFieldBegin(OUTPUT_FIELD_DESC);
        oprot.writeI32(struct.output.getValue());
        oprot.writeFieldEnd();
      }
      if (struct.data != null) {
        oprot.writeFieldBegin(DATA_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRING, struct.data.size()));
          for (String _iter35 : struct.data) {
            oprot.writeString(_iter35);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.title != null) {
        oprot.writeFieldBegin(TITLE_FIELD_DESC);
        oprot.writeString(struct.title);
        oprot.writeFieldEnd();
      }
      if (struct.description != null) {
        oprot.writeFieldBegin(DESCRIPTION_FIELD_DESC);
        oprot.writeString(struct.description);
        oprot.writeFieldEnd();
      }
      if (struct.plugin != null) {
        oprot.writeFieldBegin(PLUGIN_FIELD_DESC);
        oprot.writeString(struct.plugin);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
コード例 #7
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();
    }