当前位置: 首页>>代码示例>>Java>>正文


Java ReviewResultDetail.getSubjectId方法代码示例

本文整理汇总了Java中com.amazonaws.mturk.requester.ReviewResultDetail.getSubjectId方法的典型用法代码示例。如果您正苦于以下问题:Java ReviewResultDetail.getSubjectId方法的具体用法?Java ReviewResultDetail.getSubjectId怎么用?Java ReviewResultDetail.getSubjectId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.mturk.requester.ReviewResultDetail的用法示例。


在下文中一共展示了ReviewResultDetail.getSubjectId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printReviewReport

import com.amazonaws.mturk.requester.ReviewResultDetail; //导入方法依赖的package包/类
/**
 * 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();
  }
}
 
开发者ID:dbarowy,项目名称:java-aws-mturk,代码行数:51,代码来源:ReviewPolicyExample.java


注:本文中的com.amazonaws.mturk.requester.ReviewResultDetail.getSubjectId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。