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

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

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

      if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
        if (context.testExpression("SolutionStacks/member", targetDepth)) {
          listAvailableSolutionStacksResult
              .getSolutionStacks()
              .add(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
        if (context.testExpression("SolutionStackDetails/member", targetDepth)) {
          listAvailableSolutionStacksResult
              .getSolutionStackDetails()
              .add(SolutionStackDescriptionStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return listAvailableSolutionStacksResult;
        }
      }
    }
  }
コード例 #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof ListAvailableSolutionStacksResult == false) return false;
    ListAvailableSolutionStacksResult other = (ListAvailableSolutionStacksResult) obj;
    if (other.getSolutionStacks() == null ^ this.getSolutionStacks() == null) return false;
    if (other.getSolutionStacks() != null
        && other.getSolutionStacks().equals(this.getSolutionStacks()) == false) return false;
    if (other.getSolutionStackDetails() == null ^ this.getSolutionStackDetails() == null)
      return false;
    if (other.getSolutionStackDetails() != null
        && other.getSolutionStackDetails().equals(this.getSolutionStackDetails()) == false)
      return false;
    return true;
  }