Java 类com.amazonaws.mturk.requester.ReviewReport 实例源码

项目:java-aws-mturk    文件:ReviewPolicyExample.java   
/**
 * Helper function for printReviewResults: prints the contents of a
 * ReviewReport object.
 * @param report The ReviewReport object to print
 * @param policyName The name of the policy associated with the given report
 */
private void printReviewReport(ReviewReport report, String policyName) {
  if (report == null) {
    System.out.println("No data for policy " + policyName);
  } else {
    // Print review results
    ReviewResultDetail[] results = report.getReviewResult();
    if (results == null) {
      System.out.println("No results for policy " + policyName);
    } else {
      System.out.println("Results for policy " + policyName + ":");
      for (ReviewResultDetail result : results) {
        String subjectType = result.getSubjectType();
        String subjectId = result.getSubjectId();
        String questionId = result.getQuestionId();
        String key = result.getKey();
        String value = result.getValue();
        if (questionId == null || questionId.equals("")) {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " is " + value);
        } else {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " for " + questionId + " is " + value);
        }
      }
    }
    System.out.println();

    // Print review actions
    ReviewActionDetail[] actions = report.getReviewAction();
    if (actions == null) {
      System.out.println("No actions for policy " + policyName);
    } else {
      System.out.println("Actions for policy " + policyName + ":");
      for (ReviewActionDetail action : actions) {
        String actionName = action.getActionName();
        String actionStatus = action.getStatus().toString();
        String objectId = action.getObjectId();
        String objectType = action.getObjectType();
        String resultDescription = action.getResult();
        System.out.println("- Action " + actionName + " on " + objectType + " " + objectId + ": " + actionStatus);
        System.out.println("  Result: " + resultDescription);
      }
    }
    System.out.println();
  }
}
项目:mturksdk-java-code-maven    文件:ReviewPolicyExample.java   
/**
 * Helper function for printReviewResults: prints the contents of a
 * ReviewReport object.
 * @param report The ReviewReport object to print
 * @param policyName The name of the policy associated with the given report
 */
private void printReviewReport(ReviewReport report, String policyName) {
  if (report == null) {
    System.out.println("No data for policy " + policyName);
  } else {
    // Print review results
    ReviewResultDetail[] results = report.getReviewResult();
    if (results == null) {
      System.out.println("No results for policy " + policyName);
    } else {
      System.out.println("Results for policy " + policyName + ":");
      for (ReviewResultDetail result : results) {
        String subjectType = result.getSubjectType();
        String subjectId = result.getSubjectId();
        String questionId = result.getQuestionId();
        String key = result.getKey();
        String value = result.getValue();
        if (questionId == null || questionId.equals("")) {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " is " + value);
        } else {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " for " + questionId + " is " + value);
        }
      }
    }
    System.out.println();

    // Print review actions
    ReviewActionDetail[] actions = report.getReviewAction();
    if (actions == null) {
      System.out.println("No actions for policy " + policyName);
    } else {
      System.out.println("Actions for policy " + policyName + ":");
      for (ReviewActionDetail action : actions) {
        String actionName = action.getActionName();
        String actionStatus = action.getStatus().toString();
        String objectId = action.getObjectId();
        String objectType = action.getObjectType();
        String resultDescription = action.getResult();
        System.out.println("- Action " + actionName + " on " + objectType + " " + objectId + ": " + actionStatus);
        System.out.println("  Result: " + resultDescription);
      }
    }
    System.out.println();
  }
}
项目:gort-public    文件:ReviewPolicyExample.java   
/**
 * Helper function for printReviewResults: prints the contents of a
 * ReviewReport object.
 * @param report The ReviewReport object to print
 * @param policyName The name of the policy associated with the given report
 */
private void printReviewReport(ReviewReport report, String policyName) {
  if (report == null) {
    System.out.println("No data for policy " + policyName);
  } else {
    // Print review results
    ReviewResultDetail[] results = report.getReviewResult();
    if (results == null) {
      System.out.println("No results for policy " + policyName);
    } else {
      System.out.println("Results for policy " + policyName + ":");
      for (ReviewResultDetail result : results) {
        String subjectType = result.getSubjectType();
        String subjectId = result.getSubjectId();
        String questionId = result.getQuestionId();
        String key = result.getKey();
        String value = result.getValue();
        if (questionId == null || questionId.equals("")) {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " is " + value);
        } else {
          System.out.println("- " + subjectType + " " + subjectId + ": " + key + " for " + questionId + " is " + value);
        }
      }
    }
    System.out.println();

    // Print review actions
    ReviewActionDetail[] actions = report.getReviewAction();
    if (actions == null) {
      System.out.println("No actions for policy " + policyName);
    } else {
      System.out.println("Actions for policy " + policyName + ":");
      for (ReviewActionDetail action : actions) {
        String actionName = action.getActionName();
        String actionStatus = action.getStatus().toString();
        String objectId = action.getObjectId();
        String objectType = action.getObjectType();
        String resultDescription = action.getResult();
        System.out.println("- Action " + actionName + " on " + objectType + " " + objectId + ": " + actionStatus);
        System.out.println("  Result: " + resultDescription);
      }
    }
    System.out.println();
  }
}