.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jon Ander Peñalba - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Rename model class
19 | */
20 | public class Rename implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private final static long serialVersionUID = -4700399891066053425L;
24 |
25 | private String from;
26 |
27 | private String to;
28 |
29 | /**
30 | * @return from
31 | */
32 | public String getFrom() {
33 | return from;
34 | }
35 |
36 | /**
37 | * @param from
38 | * @return this rename model
39 | */
40 | public Rename setFrom(String from) {
41 | this.from = from;
42 | return this;
43 | }
44 |
45 | /**
46 | * @return to
47 | */
48 | public String getTo() {
49 | return to;
50 | }
51 |
52 | /**
53 | * @param to
54 | * @return this rename model
55 | */
56 | public Rename setTo(String to) {
57 | this.to = to;
58 | return this;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RepositoryBranch.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Repository branch model class
19 | */
20 | public class RepositoryBranch implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = 4927461901146433920L;
24 |
25 | private String name;
26 |
27 | private TypedResource commit;
28 |
29 | /**
30 | * @return name
31 | */
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | /**
37 | * @param name
38 | * @return this branch
39 | */
40 | public RepositoryBranch setName(String name) {
41 | this.name = name;
42 | return this;
43 | }
44 |
45 | /**
46 | * @return commit
47 | */
48 | public TypedResource getCommit() {
49 | return commit;
50 | }
51 |
52 | /**
53 | * @param commit
54 | * @return this branch
55 | */
56 | public RepositoryBranch setCommit(TypedResource commit) {
57 | this.commit = commit;
58 | return this;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RepositoryHookResponse.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Repository hook response model class
19 | */
20 | public class RepositoryHookResponse implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = -1168379336046512838L;
24 |
25 | private int code;
26 |
27 | private String message;
28 |
29 | /**
30 | * @return code
31 | */
32 | public int getCode() {
33 | return code;
34 | }
35 |
36 | /**
37 | * @param code
38 | * @return this repsonse
39 | */
40 | public RepositoryHookResponse setCode(int code) {
41 | this.code = code;
42 | return this;
43 | }
44 |
45 | /**
46 | * @return message
47 | */
48 | public String getMessage() {
49 | return message;
50 | }
51 |
52 | /**
53 | * @param message
54 | * @return this response
55 | */
56 | public RepositoryHookResponse setMessage(String message) {
57 | this.message = message;
58 | return this;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RepositoryIssue.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2012 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import org.eclipse.egit.github.core.service.IssueService;
16 |
17 | /**
18 | * Extension of {@link Issue} that includes the {@link Repository} that the
19 | * issue is in.
20 | *
21 | * This type of issue is returned from {@link IssueService} calls that don't
22 | * require an {@link IRepositoryIdProvider} to be specified and therefore the
23 | * repository information is needed to correlate which issues occur in which
24 | * repositories.
25 | */
26 | public class RepositoryIssue extends Issue {
27 |
28 | private static final long serialVersionUID = 6219926097588214812L;
29 |
30 | private Repository repository;
31 |
32 | /**
33 | * @return repository
34 | */
35 | public Repository getRepository() {
36 | return repository;
37 | }
38 |
39 | /**
40 | * @param repository
41 | * @return this issue
42 | */
43 | public RepositoryIssue setRepository(Repository repository) {
44 | this.repository = repository;
45 | return this;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RepositoryMerging.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2018 Frédéric Cilia
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Frédéric Cilia - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Repository merging model class
19 | *
20 | * @since 5.3
21 | */
22 | public class RepositoryMerging implements Serializable {
23 |
24 | private static final long serialVersionUID = 6179934015396875505L;
25 |
26 | private String base;
27 |
28 | private String head;
29 |
30 | private String commitMessage;
31 |
32 | /**
33 | * @return base
34 | */
35 | public String getBase() {
36 | return base;
37 | }
38 |
39 | /**
40 | * @param base
41 | * @return this merge
42 | */
43 | public RepositoryMerging setBase(String base) {
44 | this.base = base;
45 | return this;
46 | }
47 |
48 | /**
49 | * @return head
50 | */
51 | public String getHead() {
52 | return head;
53 | }
54 |
55 | /**
56 | * @param head
57 | * @return this merge
58 | */
59 | public RepositoryMerging setHead(String head) {
60 | this.head = head;
61 | return this;
62 | }
63 |
64 | /**
65 | * @return commitMessage
66 | */
67 | public String getCommitMessage() {
68 | return commitMessage;
69 | }
70 |
71 | /**
72 | * @param commitMessage
73 | * @return this merge
74 | */
75 | public RepositoryMerging setCommitMessage(String commitMessage) {
76 | this.commitMessage = commitMessage;
77 | return this;
78 | }
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RepositoryTag.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Repository tag model class
19 | */
20 | public class RepositoryTag implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = 1070566274663989459L;
24 |
25 | private String name;
26 |
27 | private String tarballUrl;
28 |
29 | private String zipballUrl;
30 |
31 | private TypedResource commit;
32 |
33 | /**
34 | * @return name
35 | */
36 | public String getName() {
37 | return name;
38 | }
39 |
40 | /**
41 | * @param name
42 | * @return this tag
43 | */
44 | public RepositoryTag setName(String name) {
45 | this.name = name;
46 | return this;
47 | }
48 |
49 | /**
50 | * @return tarballUrl
51 | */
52 | public String getTarballUrl() {
53 | return tarballUrl;
54 | }
55 |
56 | /**
57 | * @param tarballUrl
58 | * @return this tag
59 | */
60 | public RepositoryTag setTarballUrl(String tarballUrl) {
61 | this.tarballUrl = tarballUrl;
62 | return this;
63 | }
64 |
65 | /**
66 | * @return zipballUrl
67 | */
68 | public String getZipballUrl() {
69 | return zipballUrl;
70 | }
71 |
72 | /**
73 | * @param zipballUrl
74 | * @return this tag
75 | */
76 | public RepositoryTag setZipballUrl(String zipballUrl) {
77 | this.zipballUrl = zipballUrl;
78 | return this;
79 | }
80 |
81 | /**
82 | * @return commit
83 | */
84 | public TypedResource getCommit() {
85 | return commit;
86 | }
87 |
88 | /**
89 | * @param commit
90 | * @return this tag
91 | */
92 | public RepositoryTag setCommit(TypedResource commit) {
93 | this.commit = commit;
94 | return this;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/RequestError.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 | import java.util.List;
17 |
18 | /**
19 | * GitHub request error class
20 | */
21 | public class RequestError implements Serializable {
22 |
23 | /** serialVersionUID */
24 | private static final long serialVersionUID = -7842670602124573940L;
25 |
26 | // This field is required for legacy v2 error support
27 | private String error;
28 |
29 | private String message;
30 |
31 | private List errors;
32 |
33 | /**
34 | * @return message
35 | */
36 | public String getMessage() {
37 | return message != null ? message : error;
38 | }
39 |
40 | /**
41 | * Get errors
42 | *
43 | * @return list of errors
44 | */
45 | public List getErrors() {
46 | return errors;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/ShaResource.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Model class for resources identified by a SHA-1
19 | */
20 | public class ShaResource implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = 7029184412278953778L;
24 |
25 | private String sha;
26 |
27 | /**
28 | * @return sha
29 | */
30 | public String getSha() {
31 | return sha;
32 | }
33 |
34 | /**
35 | * @param sha
36 | * @return this resource
37 | */
38 | public ShaResource setSha(String sha) {
39 | this.sha = sha;
40 | return this;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/TeamMembership.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2014, 2015 Arizona Board of Regents
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Michael Mathews (Arizona Board of Regents) - (Bug: 447419)
12 | * Team Membership API implementation
13 | *****************************************************************************/
14 | package org.eclipse.egit.github.core;
15 |
16 | import java.io.Serializable;
17 |
18 | /**
19 | * Team Membership model class.
20 | */
21 | public class TeamMembership implements Serializable {
22 |
23 | private static final long serialVersionUID = -8207728181588115431L;
24 |
25 | /**
26 | * The possible states of a Team Membership
27 | */
28 | public static enum TeamMembershipState {
29 | /** Active member. */
30 | ACTIVE,
31 | /** Not yet active member. */
32 | PENDING;
33 | }
34 |
35 | private TeamMembershipState state;
36 |
37 | private String url;
38 |
39 | /**
40 | * @return state
41 | */
42 | public TeamMembershipState getState() {
43 | return state;
44 | }
45 |
46 | /**
47 | * @param state
48 | */
49 | public void setState(TeamMembershipState state) {
50 | this.state = state;
51 | }
52 |
53 | /**
54 | * @return url
55 | */
56 | public String getUrl() {
57 | return url;
58 | }
59 |
60 | /**
61 | * @param url
62 | */
63 | public void setUrl(String url) {
64 | this.url = url;
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/Tree.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 | import java.util.List;
17 |
18 | /**
19 | * Tree model class
20 | */
21 | public class Tree implements Serializable {
22 |
23 | /** serialVersionUID */
24 | private static final long serialVersionUID = 6518261551932913340L;
25 |
26 | private List tree;
27 |
28 | private String sha;
29 |
30 | private String url;
31 |
32 | /**
33 | * @return tree
34 | */
35 | public List getTree() {
36 | return tree;
37 | }
38 |
39 | /**
40 | * @param tree
41 | * @return this tree
42 | */
43 | public Tree setTree(List tree) {
44 | this.tree = tree;
45 | return this;
46 | }
47 |
48 | /**
49 | * @return sha
50 | */
51 | public String getSha() {
52 | return sha;
53 | }
54 |
55 | /**
56 | * @param sha
57 | * @return this tree
58 | */
59 | public Tree setSha(String sha) {
60 | this.sha = sha;
61 | return this;
62 | }
63 |
64 | /**
65 | * @return url
66 | */
67 | public String getUrl() {
68 | return url;
69 | }
70 |
71 | /**
72 | * @param url
73 | * @return this tree
74 | */
75 | public Tree setUrl(String url) {
76 | this.url = url;
77 | return this;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/TypedResource.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | /**
16 | * Resource that has type and URL fields
17 | */
18 | public class TypedResource extends ShaResource {
19 |
20 | /** serialVersionUID */
21 | private static final long serialVersionUID = -7285665432528832240L;
22 |
23 | /**
24 | * TYPE_COMMIT
25 | */
26 | public static final String TYPE_COMMIT = "commit"; //$NON-NLS-1$
27 |
28 | /**
29 | * TYPE_TAG
30 | */
31 | public static final String TYPE_TAG = "tag"; //$NON-NLS-1$
32 |
33 | /**
34 | * TYPE_BLOB
35 | */
36 | public static final String TYPE_BLOB = "blob"; //$NON-NLS-1$
37 |
38 | private String type;
39 |
40 | private String url;
41 |
42 | /**
43 | * @return type
44 | */
45 | public String getType() {
46 | return type;
47 | }
48 |
49 | /**
50 | * @param type
51 | * @return this resource
52 | */
53 | public TypedResource setType(String type) {
54 | this.type = type;
55 | return this;
56 | }
57 |
58 | /**
59 | * @return url
60 | */
61 | public String getUrl() {
62 | return url;
63 | }
64 |
65 | /**
66 | * @param url
67 | * @return this resource
68 | */
69 | public TypedResource setUrl(String url) {
70 | this.url = url;
71 | return this;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/UserPlan.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * User plan model class.
19 | */
20 | public class UserPlan implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = 4759542049129654659L;
24 |
25 | private long collaborators;
26 |
27 | private long privateRepos;
28 |
29 | private long space;
30 |
31 | private String name;
32 |
33 | /**
34 | * @return collaborators
35 | */
36 | public long getCollaborators() {
37 | return collaborators;
38 | }
39 |
40 | /**
41 | * @param collaborators
42 | * @return this user plan
43 | */
44 | public UserPlan setCollaborators(long collaborators) {
45 | this.collaborators = collaborators;
46 | return this;
47 | }
48 |
49 | /**
50 | * @return privateRepos
51 | */
52 | public long getPrivateRepos() {
53 | return privateRepos;
54 | }
55 |
56 | /**
57 | * @param privateRepos
58 | * @return this user plan
59 | */
60 | public UserPlan setPrivateRepos(long privateRepos) {
61 | this.privateRepos = privateRepos;
62 | return this;
63 | }
64 |
65 | /**
66 | * @return space
67 | */
68 | public long getSpace() {
69 | return space;
70 | }
71 |
72 | /**
73 | * @param space
74 | * @return this user plan
75 | */
76 | public UserPlan setSpace(long space) {
77 | this.space = space;
78 | return this;
79 | }
80 |
81 | /**
82 | * @return name
83 | */
84 | public String getName() {
85 | return name;
86 | }
87 |
88 | /**
89 | * @param name
90 | * @return this user plan
91 | */
92 | public UserPlan setName(String name) {
93 | this.name = name;
94 | return this;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/client/NoSuchPageException.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core.client;
14 |
15 | import java.io.IOException;
16 | import java.util.NoSuchElementException;
17 |
18 | /**
19 | * Exception class to be thrown when iterating over pages fails. This exception
20 | * wraps an {@link IOException} that is the actual exception that occurred when
21 | * the page request was made.
22 | */
23 | public class NoSuchPageException extends NoSuchElementException {
24 |
25 | /**
26 | * serialVersionUID
27 | */
28 | private static final long serialVersionUID = 6795637952359586293L;
29 |
30 | /**
31 | * Cause exception
32 | */
33 | protected final IOException cause;
34 |
35 | /**
36 | * Create no such page exception
37 | *
38 | * @param cause
39 | */
40 | public NoSuchPageException(IOException cause) {
41 | this.cause = cause;
42 | }
43 |
44 | @Override
45 | public String getMessage() {
46 | return cause != null ? cause.getMessage() : super.getMessage();
47 | }
48 |
49 | @Override
50 | public IOException getCause() {
51 | return cause;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/CommitCommentPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.CommitComment;
16 |
17 | /**
18 | * CommitCommentEvent payload model class.
19 | */
20 | public class CommitCommentPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = -2606554911096551099L;
23 |
24 | private CommitComment comment;
25 |
26 | /**
27 | * @return comment
28 | */
29 | public CommitComment getComment() {
30 | return comment;
31 | }
32 |
33 | /**
34 | * @param comment
35 | * @return this CommitCommentPayload
36 | */
37 | public CommitCommentPayload setComment(CommitComment comment) {
38 | this.comment = comment;
39 | return this;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/CreatePayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | /**
16 | * CreateEvent payload model class.
17 | */
18 | public class CreatePayload extends EventPayload {
19 |
20 | private static final long serialVersionUID = -7033027645721954674L;
21 |
22 | private String refType;
23 |
24 | private String ref;
25 |
26 | private String masterBranch;
27 |
28 | private String description;
29 |
30 | /**
31 | * @return refType
32 | */
33 | public String getRefType() {
34 | return refType;
35 | }
36 |
37 | /**
38 | * @param refType
39 | * @return this CreatePayload
40 | */
41 | public CreatePayload setRefType(String refType) {
42 | this.refType = refType;
43 | return this;
44 | }
45 |
46 | /**
47 | * @return ref
48 | */
49 | public String getRef() {
50 | return ref;
51 | }
52 |
53 | /**
54 | * @param ref
55 | * @return this CreatePayload
56 | */
57 | public CreatePayload setRef(String ref) {
58 | this.ref = ref;
59 | return this;
60 | }
61 |
62 | /**
63 | * @return masterBranch
64 | */
65 | public String getMasterBranch() {
66 | return masterBranch;
67 | }
68 |
69 | /**
70 | * @param masterBranch
71 | * @return this CreatePayload
72 | */
73 | public CreatePayload setMasterBranch(String masterBranch) {
74 | this.masterBranch = masterBranch;
75 | return this;
76 | }
77 |
78 | /**
79 | * @return description
80 | */
81 | public String getDescription() {
82 | return description;
83 | }
84 |
85 | /**
86 | * @param description
87 | * @return this CreatePayload
88 | */
89 | public CreatePayload setDescription(String description) {
90 | this.description = description;
91 | return this;
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/DeletePayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | /**
16 | * DeleteEvent payload model class.
17 | */
18 | public class DeletePayload extends EventPayload {
19 |
20 | private static final long serialVersionUID = -7571623946339106873L;
21 |
22 | private String refType;
23 |
24 | private String ref;
25 |
26 | /**
27 | * @return refType
28 | */
29 | public String getRefType() {
30 | return refType;
31 | }
32 |
33 | /**
34 | * @param refType
35 | * @return this DeletePayload
36 | */
37 | public DeletePayload setRefType(String refType) {
38 | this.refType = refType;
39 | return this;
40 | }
41 |
42 | /**
43 | * @return ref
44 | */
45 | public String getRef() {
46 | return ref;
47 | }
48 |
49 | /**
50 | * @param ref
51 | * @return this DeletePayload
52 | */
53 | public DeletePayload setRef(String ref) {
54 | this.ref = ref;
55 | return this;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/DownloadPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Download;
16 |
17 | /**
18 | * DownloadEvent payload model class.
19 | */
20 | public class DownloadPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = 4246935370658381214L;
23 |
24 | private Download download;
25 |
26 | /**
27 | * @return download
28 | */
29 | public Download getDownload() {
30 | return download;
31 | }
32 |
33 | /**
34 | * @param download
35 | * @return this DownloadPayload
36 | */
37 | public DownloadPayload setDownload(Download download) {
38 | this.download = download;
39 | return this;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/EventPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Parent class for event payloads
19 | *
20 | * @see GitHub Event types
21 | * API documentation
22 | */
23 | public class EventPayload implements Serializable {
24 |
25 | private static final long serialVersionUID = 1022083387039340606L;
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/EventRepository.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import java.io.Serializable;
16 |
17 | /**
18 | * Model class for repository information contained in an {@link Event}
19 | */
20 | public class EventRepository implements Serializable {
21 |
22 | /** serialVersionUID */
23 | private static final long serialVersionUID = -8910798454171899699L;
24 |
25 | private long id;
26 |
27 | private String name;
28 |
29 | private String url;
30 |
31 | /**
32 | * @return id
33 | */
34 | public long getId() {
35 | return id;
36 | }
37 |
38 | /**
39 | * @param id
40 | * @return this event repository
41 | */
42 | public EventRepository setId(long id) {
43 | this.id = id;
44 | return this;
45 | }
46 |
47 | /**
48 | * @return name
49 | */
50 | public String getName() {
51 | return name;
52 | }
53 |
54 | /**
55 | * @param name
56 | * @return this event repository
57 | */
58 | public EventRepository setName(String name) {
59 | this.name = name;
60 | return this;
61 | }
62 |
63 | /**
64 | * @return url
65 | */
66 | public String getUrl() {
67 | return url;
68 | }
69 |
70 | /**
71 | * @param url
72 | * @return this event repository
73 | */
74 | public EventRepository setUrl(String url) {
75 | this.url = url;
76 | return this;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/FollowPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.User;
16 |
17 | /**
18 | * FollowEvent payload model class.
19 | */
20 | public class FollowPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = -4345668254608800406L;
23 |
24 | private User target;
25 |
26 | /**
27 | * @return target
28 | */
29 | public User getTarget() {
30 | return target;
31 | }
32 |
33 | /**
34 | * @param target
35 | * @return this FollowPayload
36 | */
37 | public FollowPayload setTarget(User target) {
38 | this.target = target;
39 | return this;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/ForkApplyPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | /**
16 | * ForkApplyEvent payload model class.
17 | */
18 | public class ForkApplyPayload extends EventPayload {
19 |
20 | private static final long serialVersionUID = -7527740351672699770L;
21 |
22 | private String head;
23 |
24 | private String before;
25 |
26 | private String after;
27 |
28 | /**
29 | * @return head
30 | */
31 | public String getHead() {
32 | return head;
33 | }
34 |
35 | /**
36 | * @param head
37 | * @return this ForkApplyPayload
38 | */
39 | public ForkApplyPayload setHead(String head) {
40 | this.head = head;
41 | return this;
42 | }
43 |
44 | /**
45 | * @return before
46 | */
47 | public String getBefore() {
48 | return before;
49 | }
50 |
51 | /**
52 | * @param before
53 | * @return this ForkApplyPayload
54 | */
55 | public ForkApplyPayload setBefore(String before) {
56 | this.before = before;
57 | return this;
58 | }
59 |
60 | /**
61 | * @return after
62 | */
63 | public String getAfter() {
64 | return after;
65 | }
66 |
67 | /**
68 | * @param after
69 | * @return this ForkApplyPayload
70 | */
71 | public ForkApplyPayload setAfter(String after) {
72 | this.after = after;
73 | return this;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/ForkPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Repository;
16 |
17 | /**
18 | * ForkEvent payload model class.
19 | */
20 | public class ForkPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = 2110456722558520113L;
23 |
24 | private Repository forkee;
25 |
26 | /**
27 | * @return forkee
28 | */
29 | public Repository getForkee() {
30 | return forkee;
31 | }
32 |
33 | /**
34 | * @param forkee
35 | * @return this ForkPayload
36 | */
37 | public ForkPayload setForkee(Repository forkee) {
38 | this.forkee = forkee;
39 | return this;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/GistPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Gist;
16 |
17 | /**
18 | * GistEvent payload model class.
19 | */
20 | public class GistPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = 8916400800708594462L;
23 |
24 | private String action;
25 |
26 | private Gist gist;
27 |
28 | /**
29 | * @return action
30 | */
31 | public String getAction() {
32 | return action;
33 | }
34 |
35 | /**
36 | * @param action
37 | * @return this GistPayload
38 | */
39 | public GistPayload setAction(String action) {
40 | this.action = action;
41 | return this;
42 | }
43 |
44 | /**
45 | * @return gist
46 | */
47 | public Gist getGist() {
48 | return gist;
49 | }
50 |
51 | /**
52 | * @param gist
53 | * @return this GistPayload
54 | */
55 | public GistPayload setGist(Gist gist) {
56 | this.gist = gist;
57 | return this;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/GollumPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import java.util.List;
16 |
17 | import org.eclipse.egit.github.core.GollumPage;
18 |
19 | /**
20 | * GollumEvent payload model class.
21 | */
22 | public class GollumPayload extends EventPayload {
23 |
24 | private static final long serialVersionUID = 7111499446827257290L;
25 |
26 | private List pages;
27 |
28 | /**
29 | * @return pages
30 | */
31 | public List getPages() {
32 | return pages;
33 | }
34 |
35 | /**
36 | * @param pages
37 | * @return this GollumPayload
38 | */
39 | public GollumPayload setPages(List pages) {
40 | this.pages = pages;
41 | return this;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/IssueCommentPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Comment;
16 | import org.eclipse.egit.github.core.Issue;
17 |
18 | /**
19 | * IssueCommentEvent payload model class.
20 | */
21 | public class IssueCommentPayload extends EventPayload {
22 |
23 | private static final long serialVersionUID = 2661548417314120170L;
24 |
25 | private String action;
26 |
27 | private Issue issue;
28 |
29 | private Comment comment;
30 |
31 | /**
32 | * @return action
33 | */
34 | public String getAction() {
35 | return action;
36 | }
37 |
38 | /**
39 | * @param action
40 | * @return this IssueCommentPayload
41 | */
42 | public IssueCommentPayload setAction(String action) {
43 | this.action = action;
44 | return this;
45 | }
46 |
47 | /**
48 | * @return issue
49 | */
50 | public Issue getIssue() {
51 | return issue;
52 | }
53 |
54 | /**
55 | * @param issue
56 | * @return this IssueCommentPayload
57 | */
58 | public IssueCommentPayload setIssue(Issue issue) {
59 | this.issue = issue;
60 | return this;
61 | }
62 |
63 | /**
64 | * @return comment
65 | */
66 | public Comment getComment() {
67 | return comment;
68 | }
69 |
70 | /**
71 | * @param comment
72 | * @return this IssueCommentPayload
73 | */
74 | public IssueCommentPayload setComment(Comment comment) {
75 | this.comment = comment;
76 | return this;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/IssuesPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Issue;
16 |
17 | /**
18 | * IssuesEvent payload model class.
19 | */
20 | public class IssuesPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = 3210795492806809443L;
23 |
24 | private String action;
25 |
26 | private Issue issue;
27 |
28 | /**
29 | * @return action
30 | */
31 | public String getAction() {
32 | return action;
33 | }
34 |
35 | /**
36 | * @param action
37 | * @return this IssuesPayload
38 | */
39 | public IssuesPayload setAction(String action) {
40 | this.action = action;
41 | return this;
42 | }
43 |
44 | /**
45 | * @return issue
46 | */
47 | public Issue getIssue() {
48 | return issue;
49 | }
50 |
51 | /**
52 | * @param issue
53 | * @return this IssuesPayload
54 | */
55 | public IssuesPayload setIssue(Issue issue) {
56 | this.issue = issue;
57 | return this;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/MemberPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.User;
16 |
17 | /**
18 | * MemberEvent payload model class.
19 | */
20 | public class MemberPayload extends EventPayload {
21 |
22 | private static final long serialVersionUID = -4261757812093447848L;
23 |
24 | private User member;
25 |
26 | private String action;
27 |
28 | /**
29 | * @return member
30 | */
31 | public User getMember() {
32 | return member;
33 | }
34 |
35 | /**
36 | * @param member
37 | * @return this MemberPayload
38 | */
39 | public MemberPayload setMember(User member) {
40 | this.member = member;
41 | return this;
42 | }
43 |
44 | /**
45 | * @return action
46 | */
47 | public String getAction() {
48 | return action;
49 | }
50 |
51 | /**
52 | * @param action
53 | * @return this MemberPayload
54 | */
55 | public MemberPayload setAction(String action) {
56 | this.action = action;
57 | return this;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/PublicPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | /**
16 | * PublicEvent payload model class.
17 | */
18 | public class PublicPayload extends EventPayload {
19 |
20 | private static final long serialVersionUID = 5262549236565872052L;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/PullRequestPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 |
14 | package org.eclipse.egit.github.core.event;
15 |
16 | import org.eclipse.egit.github.core.PullRequest;
17 |
18 | /**
19 | * PullRequestEvent payload model class.
20 | */
21 | public class PullRequestPayload extends EventPayload {
22 |
23 | private static final long serialVersionUID = -8234504270587265625L;
24 |
25 | private String action;
26 |
27 | private int number;
28 |
29 | private PullRequest pullRequest;
30 |
31 | /**
32 | * @return action
33 | */
34 | public String getAction() {
35 | return action;
36 | }
37 |
38 | /**
39 | * @param action
40 | * @return this PullRequestPayload
41 | */
42 | public PullRequestPayload setAction(String action) {
43 | this.action = action;
44 | return this;
45 | }
46 |
47 | /**
48 | * @return number
49 | */
50 | public int getNumber() {
51 | return number;
52 | }
53 |
54 | /**
55 | * @param number
56 | * @return this PullRequestPayload
57 | */
58 | public PullRequestPayload setNumber(int number) {
59 | this.number = number;
60 | return this;
61 | }
62 |
63 | /**
64 | * @return pullRequest
65 | */
66 | public PullRequest getPullRequest() {
67 | return pullRequest;
68 | }
69 |
70 | /**
71 | * @param pullRequest
72 | * @return this PullRequestPayload
73 | */
74 | public PullRequestPayload setPullRequest(PullRequest pullRequest) {
75 | this.pullRequest = pullRequest;
76 | return this;
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/PullRequestReviewCommentPayload.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2012 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.CommitComment;
16 | import org.eclipse.egit.github.core.PullRequest;
17 |
18 | /**
19 | * Payload for an event with type {@link Event#TYPE_PULL_REQUEST_REVIEW_COMMENT}
20 | */
21 | public class PullRequestReviewCommentPayload extends EventPayload {
22 |
23 | private static final long serialVersionUID = -2403658752886394741L;
24 |
25 | private String action;
26 |
27 | private CommitComment comment;
28 |
29 | private PullRequest pullRequest;
30 |
31 | /**
32 | * @return action
33 | * @since 4.1
34 | */
35 | public String getAction() {
36 | return action;
37 | }
38 |
39 | /**
40 | * @param action
41 | * @return this PullRequestReviewCommentPayload
42 | * @since 4.1
43 | */
44 | public PullRequestReviewCommentPayload setAction(String action) {
45 | this.action = action;
46 | return this;
47 | }
48 |
49 | /**
50 | * @return comment
51 | */
52 | public CommitComment getComment() {
53 | return comment;
54 | }
55 |
56 | /**
57 | * @param comment
58 | * @return this payload
59 | */
60 | public PullRequestReviewCommentPayload setComment(CommitComment comment) {
61 | this.comment = comment;
62 | return this;
63 | }
64 |
65 | /**
66 | * @return pullRequest
67 | * @since 4.1
68 | */
69 | public PullRequest getPullRequest() {
70 | return pullRequest;
71 | }
72 |
73 | /**
74 | * @param pullRequest
75 | * @return this PullRequestReviewCommentPayload
76 | * @since 4.1
77 | */
78 | public PullRequestReviewCommentPayload setPullRequest(PullRequest pullRequest) {
79 | this.pullRequest = pullRequest;
80 | return this;
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/ReleasePayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 Jon Ander Peñalba .
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jon Ander Peñalba - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Release;
16 |
17 | /**
18 | * ReleaseEvent payload model class.
19 | * @since 4.2
20 | */
21 | public class ReleasePayload extends EventPayload {
22 |
23 | private static final long serialVersionUID = 3309944674574815351L;
24 |
25 | private String action;
26 |
27 | private Release release;
28 |
29 | /**
30 | * @return action
31 | */
32 | public String getAction() {
33 | return action;
34 | }
35 |
36 | /**
37 | * @param action
38 | * @return this ReleasePayload
39 | */
40 | public ReleasePayload setAction(String action) {
41 | this.action = action;
42 | return this;
43 | }
44 |
45 | /**
46 | * @return release
47 | */
48 | public Release getRelease() {
49 | return release;
50 | }
51 |
52 | /**
53 | * @param release
54 | * @return this ReleasePayload
55 | */
56 | public ReleasePayload setRelease(Release release) {
57 | this.release = release;
58 | return this;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/TeamAddPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | import org.eclipse.egit.github.core.Repository;
16 | import org.eclipse.egit.github.core.Team;
17 | import org.eclipse.egit.github.core.User;
18 |
19 | /**
20 | * TeamAddEvent payload model class
21 | */
22 | public class TeamAddPayload extends EventPayload {
23 |
24 | private static final long serialVersionUID = 7660176723347977144L;
25 |
26 | private Team team;
27 |
28 | private User user;
29 |
30 | private Repository repo;
31 |
32 | /**
33 | * @return team
34 | */
35 | public Team getTeam() {
36 | return team;
37 | }
38 |
39 | /**
40 | * @param team
41 | * @return this TeamAddPayload
42 | */
43 | public TeamAddPayload setTeam(Team team) {
44 | this.team = team;
45 | return this;
46 | }
47 |
48 | /**
49 | * @return user
50 | */
51 | public User getUser() {
52 | return user;
53 | }
54 |
55 | /**
56 | * @param user
57 | * @return this TeamAddPayload
58 | */
59 | public TeamAddPayload setUser(User user) {
60 | this.user = user;
61 | return this;
62 | }
63 |
64 | /**
65 | * @return repo
66 | */
67 | public Repository getRepo() {
68 | return repo;
69 | }
70 |
71 | /**
72 | * @param repo
73 | * @return this TeamAddPayload
74 | */
75 | public TeamAddPayload setRepo(Repository repo) {
76 | this.repo = repo;
77 | return this;
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/event/WatchPayload.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Jason Tsay (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.event;
14 |
15 | /**
16 | * WatchEvent payload model class.
17 | */
18 | public class WatchPayload extends EventPayload {
19 |
20 | private static final long serialVersionUID = -1600566006173513492L;
21 |
22 | private String action;
23 |
24 | /**
25 | * @return action
26 | */
27 | public String getAction() {
28 | return action;
29 | }
30 |
31 | /**
32 | * @param action
33 | * @return this WatchPayload
34 | */
35 | public WatchPayload setAction(String action) {
36 | this.action = action;
37 | return this;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/util/DateUtils.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core.util;
14 |
15 | import java.util.Date;
16 |
17 | /**
18 | * Date utilities
19 | */
20 | public final class DateUtils {
21 |
22 | private DateUtils() {
23 | // utility class
24 | }
25 |
26 | /**
27 | * Clone date if non-null
28 | *
29 | * @param date
30 | * @return copied date
31 | */
32 | public static Date clone(final Date date) {
33 | if (date == null)
34 | return null;
35 | return new Date(date.getTime());
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/util/EncodingUtils.java:
--------------------------------------------------------------------------------
1 | /******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *****************************************************************************/
13 | package org.eclipse.egit.github.core.util;
14 |
15 | import static org.eclipse.egit.github.core.client.IGitHubConstants.CHARSET_UTF8;
16 |
17 | import java.io.UnsupportedEncodingException;
18 |
19 | /**
20 | * Encoding utilities
21 | */
22 | public final class EncodingUtils {
23 |
24 | private EncodingUtils() {
25 | // utility class
26 | }
27 |
28 | /**
29 | * Decode base64 encoded string
30 | *
31 | * @param content
32 | * @return byte array
33 | */
34 | public static final byte[] fromBase64(final String content) {
35 | return Base64.decode(content);
36 | }
37 |
38 | /**
39 | * Base64 encode given byte array
40 | *
41 | * @param content
42 | * @return byte array
43 | */
44 | public static final String toBase64(final byte[] content) {
45 | return Base64.encodeBytes(content);
46 | }
47 |
48 | /**
49 | * Base64 encode given byte array
50 | *
51 | * @param content
52 | * @return byte array
53 | */
54 | public static final String toBase64(final String content) {
55 | byte[] bytes;
56 | try {
57 | bytes = content.getBytes(CHARSET_UTF8);
58 | } catch (UnsupportedEncodingException e) {
59 | bytes = content.getBytes();
60 | }
61 | return toBase64(bytes);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/main/java/org/eclipse/egit/github/core/util/LabelComparator.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2011 GitHub Inc.
3 | * All rights reserved. This program and the accompanying materials
4 | * are made available under the terms of the Eclipse Public License 2.0
5 | * which accompanies this distribution, and is available at
6 | * https://www.eclipse.org/legal/epl-2.0/
7 | *
8 | * SPDX-License-Identifier: EPL-2.0
9 | *
10 | * Contributors:
11 | * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 | *******************************************************************************/
13 | package org.eclipse.egit.github.core.util;
14 |
15 | import java.io.Serializable;
16 | import java.util.Comparator;
17 |
18 | import org.eclipse.egit.github.core.Label;
19 |
20 | /**
21 | * Label comparator using case-insensitive name comparisons.
22 | */
23 | public class LabelComparator implements Comparator