• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IssueCommentPayload类的典型用法和代码示例

java 1次浏览

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

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

示例1: handleIssueCommentEvent

点赞 3

import org.eclipse.egit.github.core.event.IssueCommentPayload; //导入依赖的package包/类
private IssuePojo handleIssueCommentEvent(IssuePojo issuePojo, EventPayload eventPayload) {
    IssueCommentPayload issueCommentPayload = (IssueCommentPayload) eventPayload;

    issuePojo = extractIssueFields(issueCommentPayload.getIssue(), issuePojo);

    if (issueCommentPayload.getComment().getBody() != null) {
        issuePojo.setActionBody(issueCommentPayload.getComment().getBody());
    }

    switch (issueCommentPayload.getAction()) {
        case "created":
            issuePojo.setIssueEventType(IssuePojo.IssueEventType.ISSUE_COMMENTED);
            break;

        default:
            System.out.println(" !!! UNKNOWN : " + issueCommentPayload.getAction());
            issuePojo.setIssueEventType(IssuePojo.IssueEventType.UNKNOWN);
            break;
    }

    return issuePojo;
}
 

开发者ID:stola3,
项目名称:github-issue-events-report,
代码行数:23,
代码来源:IssueEventCollector.java

示例2: process

点赞 2

import org.eclipse.egit.github.core.event.IssueCommentPayload; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void process(Repository repository, Event event, boolean isSoftSync, String[] synchronizationTags, GitHubEventContext context)
{
    IssueCommentPayload payload = getPayload(event);

    // if payload doesn't contain information about issue we can stop
    if (payload.getIssue() == null)
    {
        return;
    }

    PullRequest pullRequest = payload.getIssue().getPullRequest();

    // it can happen that the issue is not related to pull request (only issue is created)
    // and the repository is null here
    if (pullRequest == null)
    {
        return;
    }

    // reloads PR-s by HTML URL because PR of issue's comment does not contains any other PR informations
    pullRequest = getPullRequestByHtmlUrl(repository, pullRequest.getHtmlUrl());
    if (pullRequest == null)
    {
        return;
    }

    context.savePullRequest(pullRequest);
}
 

开发者ID:edgehosting,
项目名称:jira-dvcs-connector,
代码行数:33,
代码来源:IssueCommentPayloadEventProcessor.java

示例3: getEventPayloadType

点赞 2

import org.eclipse.egit.github.core.event.IssueCommentPayload; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Class<IssueCommentPayload> getEventPayloadType()
{
    return IssueCommentPayload.class;
}
 

开发者ID:edgehosting,
项目名称:jira-dvcs-connector,
代码行数:9,
代码来源:IssueCommentPayloadEventProcessor.java

示例4: deserialize

点赞 2

import org.eclipse.egit.github.core.event.IssueCommentPayload; //导入依赖的package包/类
public Event deserialize(JsonElement json, Type typeOfT,
		JsonDeserializationContext context) throws JsonParseException {
	final Event event = gson.fromJson(json, Event.class);
	if (event == null || !json.isJsonObject())
		return event;
	final JsonElement rawPayload = json.getAsJsonObject().get("payload");
	if (rawPayload == null || !rawPayload.isJsonObject())
		return event;
	final String type = event.getType();
	if (type == null || type.length() == 0)
		return event;

	Class<? extends EventPayload> payloadClass;
	if (TYPE_COMMIT_COMMENT.equals(type))
		payloadClass = CommitCommentPayload.class;
	else if (TYPE_CREATE.equals(type))
		payloadClass = CreatePayload.class;
	else if (TYPE_DELETE.equals(type))
		payloadClass = DeletePayload.class;
	else if (TYPE_DOWNLOAD.equals(type))
		payloadClass = DownloadPayload.class;
	else if (TYPE_FOLLOW.equals(type))
		payloadClass = FollowPayload.class;
	else if (TYPE_FORK.equals(type))
		payloadClass = ForkPayload.class;
	else if (TYPE_FORK_APPLY.equals(type))
		payloadClass = ForkApplyPayload.class;
	else if (TYPE_GIST.equals(type))
		payloadClass = GistPayload.class;
	else if (TYPE_GOLLUM.equals(type))
		payloadClass = GollumPayload.class;
	else if (TYPE_ISSUE_COMMENT.equals(type))
		payloadClass = IssueCommentPayload.class;
	else if (TYPE_ISSUES.equals(type))
		payloadClass = IssuesPayload.class;
	else if (TYPE_MEMBER.equals(type))
		payloadClass = MemberPayload.class;
	else if (TYPE_PUBLIC.equals(type))
		payloadClass = PublicPayload.class;
	else if (TYPE_PULL_REQUEST.equals(type))
		payloadClass = PullRequestPayload.class;
	else if (TYPE_PULL_REQUEST_REVIEW_COMMENT.equals(type))
		payloadClass = PullRequestReviewCommentPayload.class;
	else if (TYPE_PUSH.equals(type))
		payloadClass = PushPayload.class;
	else if (TYPE_RELEASE.equals(type))
		payloadClass = ReleasePayload.class;
	else if (TYPE_TEAM_ADD.equals(type))
		payloadClass = TeamAddPayload.class;
	else if (TYPE_WATCH.equals(type))
		payloadClass = WatchPayload.class;
	else
		return event;

	try {
		EventPayload typedPayload = context.deserialize(rawPayload,
				payloadClass);
		return event.setPayload(typedPayload);
	} catch (JsonParseException jpe) {
		// Parse exception here denotes legacy payloads with differing
		// fields than built-in payload classes provide
		return event;
	}
}
 

开发者ID:tsangiotis,
项目名称:JekyllForAndroid,
代码行数:65,
代码来源:EventFormatter.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)