當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。