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


Java EasyMap类代码示例

本文整理汇总了Java中com.atlassian.core.util.map.EasyMap的典型用法代码示例。如果您正苦于以下问题:Java EasyMap类的具体用法?Java EasyMap怎么用?Java EasyMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onIssueEvent

import com.atlassian.core.util.map.EasyMap; //导入依赖的package包/类
@EventListener
public void onIssueEvent(IssueEvent issueEvent)
{
    Issue issue = issueEvent.getIssue();
    Comment comment = issueEvent.getComment();
    JamClient jamClient = new JamClient(applicationLinkService, hostApplication, issueManager);

    Long eventTypeId = issueEvent.getEventTypeId();
    String eventBlurb = null;
    if (eventTypeId.equals(EventType.ISSUE_COMMENTED_ID)) {
      // Ignore comments on their own. Non-empty comments are appended to the action
      // at the end of this if block.
    } else if (eventTypeId.equals(EventType.ISSUE_UPDATED_ID) ||
               eventTypeId.equals(EventType.ISSUE_RESOLVED_ID) ||
               eventTypeId.equals(EventType.ISSUE_REOPENED_ID) ||
               eventTypeId.equals(EventType.ISSUE_ASSIGNED_ID) ||
               eventTypeId.equals(EventType.ISSUE_CLOSED_ID) ||
               eventTypeId.equals(EventType.ISSUE_WORKSTOPPED_ID) ||
               eventTypeId.equals(EventType.ISSUE_WORKSTARTED_ID)) {
      List<GenericValue> changeItems = null;
      try {
          GenericValue changeLog = issueEvent.getChangeLog();
          changeItems = changeLog.internalDelegator.findByAnd("ChangeItem", EasyMap.build("group", changeLog.get("id")));
      } catch (GenericEntityException e){
        e.printStackTrace();
      } 

      if (changeItems != null) {
        eventBlurb = "Summary of updated values:\n";
        for (GenericValue genericValue : changeItems) {
          String field = genericValue.getString("field");
          String oldString = genericValue.getString("oldstring");
          String newString = genericValue.getString("newstring");
          String oldId = genericValue.getString("oldvalue");
          String newId = genericValue.getString("newvalue");
          eventBlurb +=
              field + ": <b>" +
              (oldString == null ? " " : oldString) +
              (oldId == null ? "" : "[" + oldId + "]") +
              "</b> to <b>" +
              (newString == null ? " " : newString) +
              (newId == null ? "" : "[" + newId + "]") +
              "</b>\n";
        }
      }
    }

    if (comment != null) {
      if (eventBlurb == null) {
        eventBlurb = comment.getBody();
      } else {
        eventBlurb += "\n" + comment.getBody();
      }
    }

    if (eventBlurb != null) {
      jamClient.postIssueActivity(issue, eventBlurb);
    }
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:60,代码来源:JamEventListener.java


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