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

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

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

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

        if (context.testExpression("arn", targetDepth)) {
          iamInstanceProfile.setArn(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }

        if (context.testExpression("id", targetDepth)) {
          iamInstanceProfile.setId(StringStaxUnmarshaller.getInstance().unmarshall(context));
          continue;
        }
      } else if (xmlEvent.isEndElement()) {
        if (context.getCurrentDepth() < originalDepth) {
          return iamInstanceProfile;
        }
      }
    }
  }
コード例 #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

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

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