@Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof DescribeAddressesRequest == false) return false;
    DescribeAddressesRequest other = (DescribeAddressesRequest) obj;

    if (other.getPublicIps() == null ^ this.getPublicIps() == null) return false;
    if (other.getPublicIps() != null && other.getPublicIps().equals(this.getPublicIps()) == false)
      return false;
    if (other.getFilters() == null ^ this.getFilters() == null) return false;
    if (other.getFilters() != null && other.getFilters().equals(this.getFilters()) == false)
      return false;
    if (other.getAllocationIds() == null ^ this.getAllocationIds() == null) return false;
    if (other.getAllocationIds() != null
        && other.getAllocationIds().equals(this.getAllocationIds()) == false) return false;
    return true;
  }
  public Request<DescribeAddressesRequest> marshall(
      DescribeAddressesRequest describeAddressesRequest) {
    Request<DescribeAddressesRequest> request =
        new DefaultRequest<DescribeAddressesRequest>(describeAddressesRequest, "AmazonEC2");
    request.addParameter("Action", "DescribeAddresses");
    request.addParameter("Version", "2011-05-15");
    if (describeAddressesRequest != null) {
      java.util.List<String> publicIpsList = describeAddressesRequest.getPublicIps();
      int publicIpsListIndex = 1;

      for (String publicIpsListValue : publicIpsList) {
        if (publicIpsListValue != null) {
          request.addParameter(
              "PublicIp." + publicIpsListIndex, StringUtils.fromString(publicIpsListValue));
        }
        publicIpsListIndex++;
      }
    }

    if (describeAddressesRequest != null) {
      java.util.List<Filter> filtersList = describeAddressesRequest.getFilters();
      int filtersListIndex = 1;
      for (Filter filtersListValue : filtersList) {
        if (filtersListValue != null) {
          if (filtersListValue.getName() != null) {
            request.addParameter(
                "Filter." + filtersListIndex + ".Name",
                StringUtils.fromString(filtersListValue.getName()));
          }
        }
        if (filtersListValue != null) {
          java.util.List<String> valuesList = filtersListValue.getValues();
          int valuesListIndex = 1;

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

        filtersListIndex++;
      }
    }
    if (describeAddressesRequest != null) {
      java.util.List<String> allocationIdsList = describeAddressesRequest.getAllocationIds();
      int allocationIdsListIndex = 1;

      for (String allocationIdsListValue : allocationIdsList) {
        if (allocationIdsListValue != null) {
          request.addParameter(
              "AllocationId." + allocationIdsListIndex,
              StringUtils.fromString(allocationIdsListValue));
        }
        allocationIdsListIndex++;
      }
    }

    return request;
  }