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


Java HIT.getDescription方法代码示例

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


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

示例1: updateHIT

import com.amazonaws.mturk.requester.HIT; //导入方法依赖的package包/类
/**
 * Updates a HIT with new title, description, keywords, and reward. If new values are 
 * not specified, the values from the original HIT are used. The following default values 
 * are used:
 * <ul>
 *  <li>AssignmentDurationInSeconds: 1 hour</li>
 *  <li>AutoApprovalDelayInSeconds:  15 days</li>
 *  <li>QualificationRequirement: null</li>
 * </ul>
 * 
 * @param hitId        the Id of the HIT to update
 * @param title        the title of the updated HIT. If null, the current title 
 *                     of the HIT is used.
 * @param description  the description of the updated HIT. If null, the current description 
 *                     of the HIT is used.
 * @param keywords     one or more words or phrases to describe the updated HIT. If null, 
 *                     the current keywords are used.                  
 * @param reward       the amount to pay for the updated HIT when completed. If null, the 
 *                     the current reward of the HIT is used.
 * @return the new HITType Id
 * @throws ServiceException
 */
public String updateHIT(String hitId, String title, String description, String keywords,
    Double reward) throws ServiceException {
  if (title == null || description == null || keywords == null || reward == null) {
    HIT currentHIT = this.getHIT(hitId);
    if (title == null) {
      title = currentHIT.getTitle();
    }
    if (description == null) {
      description = currentHIT.getDescription();
    }
    if (keywords == null) {
      keywords = currentHIT.getKeywords();
    }
    if (reward == null) {
      reward = currentHIT.getReward().getAmount().doubleValue();
    }
  }
  String newHITTypeId = this.registerHITType(
      DEFAULT_AUTO_APPROVAL_DELAY_IN_SECONDS,
      DEFAULT_ASSIGNMENT_DURATION_IN_SECONDS,
      reward,
      title,
      keywords,
      description,
      null); // qualificationRequirements
  this.changeHITTypeOfHIT(hitId, newHITTypeId);
  return newHITTypeId;
}
 
开发者ID:dbarowy,项目名称:java-aws-mturk,代码行数:51,代码来源:RequesterService.java


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