コード例 #1
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeConversionTasksRequest == false) return false;
    DescribeConversionTasksRequest other = (DescribeConversionTasksRequest) obj;
    if (other.getConversionTaskIds() == null ^ this.getConversionTaskIds() == null) return false;
    if (other.getConversionTaskIds() != null
        && other.getConversionTaskIds().equals(this.getConversionTaskIds()) == false) return false;
    return true;
  }
  public Request<DescribeConversionTasksRequest> marshall(
      DescribeConversionTasksRequest describeConversionTasksRequest) {

    if (describeConversionTasksRequest == null) {
      throw new AmazonClientException("Invalid argument passed to marshall(...)");
    }

    Request<DescribeConversionTasksRequest> request =
        new DefaultRequest<DescribeConversionTasksRequest>(
            describeConversionTasksRequest, "AmazonEC2");
    request.addParameter("Action", "DescribeConversionTasks");
    request.addParameter("Version", "2015-10-01");
    request.setHttpMethod(HttpMethodName.POST);

    com.amazonaws.internal.SdkInternalList<Filter> filtersList =
        (com.amazonaws.internal.SdkInternalList<Filter>)
            describeConversionTasksRequest.getFilters();
    if (!filtersList.isEmpty() || !filtersList.isAutoConstruct()) {
      int filtersListIndex = 1;

      for (Filter filtersListValue : filtersList) {

        if (filtersListValue.getName() != null) {
          request.addParameter(
              "Filter." + filtersListIndex + ".Name",
              StringUtils.fromString(filtersListValue.getName()));
        }

        com.amazonaws.internal.SdkInternalList<String> valuesList =
            (com.amazonaws.internal.SdkInternalList<String>) filtersListValue.getValues();
        if (!valuesList.isEmpty() || !valuesList.isAutoConstruct()) {
          int valuesListIndex = 1;

          for (String valuesListValue : valuesList) {
            if (valuesListValue != null) {
              request.addParameter(
                  "Filter." + filtersListIndex + ".Value." + valuesListIndex,
                  StringUtils.fromString(valuesListValue));
            }
            valuesListIndex++;
          }
        }
        filtersListIndex++;
      }
    }

    com.amazonaws.internal.SdkInternalList<String> conversionTaskIdsList =
        (com.amazonaws.internal.SdkInternalList<String>)
            describeConversionTasksRequest.getConversionTaskIds();
    if (!conversionTaskIdsList.isEmpty() || !conversionTaskIdsList.isAutoConstruct()) {
      int conversionTaskIdsListIndex = 1;

      for (String conversionTaskIdsListValue : conversionTaskIdsList) {
        if (conversionTaskIdsListValue != null) {
          request.addParameter(
              "ConversionTaskId." + conversionTaskIdsListIndex,
              StringUtils.fromString(conversionTaskIdsListValue));
        }
        conversionTaskIdsListIndex++;
      }
    }

    return request;
  }