本文整理汇总了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);
}
}