public DescribeScalingActivitiesResult unmarshall(StaxUnmarshallerContext context)
      throws Exception {
    DescribeScalingActivitiesResult describeScalingActivitiesResult =
        new DescribeScalingActivitiesResult();
    int originalDepth = context.getCurrentDepth();
    int targetDepth = originalDepth + 1;

    if (context.isStartOfDocument()) targetDepth += 2;

    while (true) {
      XMLEvent xmlEvent = context.nextEvent();
      if (xmlEvent.isEndDocument()) return describeScalingActivitiesResult;

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {

        if (context.testExpression("Activities/member", targetDepth)) {
          describeScalingActivitiesResult
              .getActivities()
              .add(ActivityStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("NextToken", targetDepth)) {
          describeScalingActivitiesResult.setNextToken(
              StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return describeScalingActivitiesResult;
        }
      }
    }
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

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

    if (other.getActivities() == null ^ this.getActivities() == null) return false;
    if (other.getActivities() != null
        && other.getActivities().equals(this.getActivities()) == false) return false;
    if (other.getNextToken() == null ^ this.getNextToken() == null) return false;
    if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
      return false;
    return true;
  }