public RecordDetail unmarshall(JsonUnmarshallerContext context) throws Exception {
    RecordDetail recordDetail = new RecordDetail();

    int originalDepth = context.getCurrentDepth();
    String currentParentElement = context.getCurrentParentElement();
    int targetDepth = originalDepth + 1;

    JsonToken token = context.getCurrentToken();
    if (token == null) token = context.nextToken();
    if (token == VALUE_NULL) return null;

    while (true) {
      if (token == null) break;

      if (token == FIELD_NAME || token == START_OBJECT) {
        if (context.testExpression("RecordId", targetDepth)) {
          context.nextToken();
          recordDetail.setRecordId(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("ProvisionedProductName", targetDepth)) {
          context.nextToken();
          recordDetail.setProvisionedProductName(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("Status", targetDepth)) {
          context.nextToken();
          recordDetail.setStatus(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("CreatedTime", targetDepth)) {
          context.nextToken();
          recordDetail.setCreatedTime(
              context.getUnmarshaller(java.util.Date.class).unmarshall(context));
        }
        if (context.testExpression("UpdatedTime", targetDepth)) {
          context.nextToken();
          recordDetail.setUpdatedTime(
              context.getUnmarshaller(java.util.Date.class).unmarshall(context));
        }
        if (context.testExpression("ProvisionedProductType", targetDepth)) {
          context.nextToken();
          recordDetail.setProvisionedProductType(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("RecordType", targetDepth)) {
          context.nextToken();
          recordDetail.setRecordType(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("ProvisionedProductId", targetDepth)) {
          context.nextToken();
          recordDetail.setProvisionedProductId(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("ProductId", targetDepth)) {
          context.nextToken();
          recordDetail.setProductId(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("ProvisioningArtifactId", targetDepth)) {
          context.nextToken();
          recordDetail.setProvisioningArtifactId(
              context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("PathId", targetDepth)) {
          context.nextToken();
          recordDetail.setPathId(context.getUnmarshaller(String.class).unmarshall(context));
        }
        if (context.testExpression("RecordErrors", targetDepth)) {
          context.nextToken();
          recordDetail.setRecordErrors(
              new ListUnmarshaller<RecordError>(RecordErrorJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
        if (context.testExpression("RecordTags", targetDepth)) {
          context.nextToken();
          recordDetail.setRecordTags(
              new ListUnmarshaller<RecordTag>(RecordTagJsonUnmarshaller.getInstance())
                  .unmarshall(context));
        }
      } else if (token == END_ARRAY || token == END_OBJECT) {
        if (context.getLastParsedParentElement() == null
            || context.getLastParsedParentElement().equals(currentParentElement)) {
          if (context.getCurrentDepth() <= originalDepth) break;
        }
      }
      token = context.nextToken();
    }

    return recordDetail;
  }
Example #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;

    if (obj instanceof RecordDetail == false) return false;
    RecordDetail other = (RecordDetail) obj;
    if (other.getRecordId() == null ^ this.getRecordId() == null) return false;
    if (other.getRecordId() != null && other.getRecordId().equals(this.getRecordId()) == false)
      return false;
    if (other.getProvisionedProductName() == null ^ this.getProvisionedProductName() == null)
      return false;
    if (other.getProvisionedProductName() != null
        && other.getProvisionedProductName().equals(this.getProvisionedProductName()) == false)
      return false;
    if (other.getStatus() == null ^ this.getStatus() == null) return false;
    if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
      return false;
    if (other.getCreatedTime() == null ^ this.getCreatedTime() == null) return false;
    if (other.getCreatedTime() != null
        && other.getCreatedTime().equals(this.getCreatedTime()) == false) return false;
    if (other.getUpdatedTime() == null ^ this.getUpdatedTime() == null) return false;
    if (other.getUpdatedTime() != null
        && other.getUpdatedTime().equals(this.getUpdatedTime()) == false) return false;
    if (other.getProvisionedProductType() == null ^ this.getProvisionedProductType() == null)
      return false;
    if (other.getProvisionedProductType() != null
        && other.getProvisionedProductType().equals(this.getProvisionedProductType()) == false)
      return false;
    if (other.getRecordType() == null ^ this.getRecordType() == null) return false;
    if (other.getRecordType() != null
        && other.getRecordType().equals(this.getRecordType()) == false) return false;
    if (other.getProvisionedProductId() == null ^ this.getProvisionedProductId() == null)
      return false;
    if (other.getProvisionedProductId() != null
        && other.getProvisionedProductId().equals(this.getProvisionedProductId()) == false)
      return false;
    if (other.getProductId() == null ^ this.getProductId() == null) return false;
    if (other.getProductId() != null && other.getProductId().equals(this.getProductId()) == false)
      return false;
    if (other.getProvisioningArtifactId() == null ^ this.getProvisioningArtifactId() == null)
      return false;
    if (other.getProvisioningArtifactId() != null
        && other.getProvisioningArtifactId().equals(this.getProvisioningArtifactId()) == false)
      return false;
    if (other.getPathId() == null ^ this.getPathId() == null) return false;
    if (other.getPathId() != null && other.getPathId().equals(this.getPathId()) == false)
      return false;
    if (other.getRecordErrors() == null ^ this.getRecordErrors() == null) return false;
    if (other.getRecordErrors() != null
        && other.getRecordErrors().equals(this.getRecordErrors()) == false) return false;
    if (other.getRecordTags() == null ^ this.getRecordTags() == null) return false;
    if (other.getRecordTags() != null
        && other.getRecordTags().equals(this.getRecordTags()) == false) return false;
    return true;
  }