|
| 1 | +/* |
| 2 | + * The MIT License |
| 3 | + * |
| 4 | + * Copyright (c) 2013, Luca Milanesio |
| 5 | + * |
| 6 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + * of this software and associated documentation files (the "Software"), to deal |
| 8 | + * in the Software without restriction, including without limitation the rights |
| 9 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + * copies of the Software, and to permit persons to whom the Software is |
| 11 | + * furnished to do so, subject to the following conditions: |
| 12 | + * |
| 13 | + * The above copyright notice and this permission notice shall be included in |
| 14 | + * all copies or substantial portions of the Software. |
| 15 | + * |
| 16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | + * SOFTWARE. |
| 23 | + */ |
| 24 | +package org.kohsuke.github; |
| 25 | + |
| 26 | +import java.net.URL; |
| 27 | +import java.util.Date; |
| 28 | + |
| 29 | +/** |
| 30 | + * Commit detail inside a {@link GHPullRequest}. |
| 31 | + * |
| 32 | + * @author Luca Milanesio |
| 33 | + */ |
| 34 | +public class GHPullRequestCommitDetail { |
| 35 | + |
| 36 | + public static class Authorship { |
| 37 | + String name; |
| 38 | + String email; |
| 39 | + String date; |
| 40 | + |
| 41 | + public String getName() { |
| 42 | + return name; |
| 43 | + } |
| 44 | + |
| 45 | + public String getEmail() { |
| 46 | + return email; |
| 47 | + } |
| 48 | + |
| 49 | + public Date getDate() { |
| 50 | + return GitHub.parseDate(date); |
| 51 | + } |
| 52 | + } |
| 53 | + |
| 54 | + public static class Tree { |
| 55 | + String sha; |
| 56 | + String url; |
| 57 | + |
| 58 | + public String getSha() { |
| 59 | + return sha; |
| 60 | + } |
| 61 | + |
| 62 | + public URL getUrl() { |
| 63 | + return GitHub.parseURL(url); |
| 64 | + } |
| 65 | + } |
| 66 | + |
| 67 | + public static class Commit { |
| 68 | + Authorship author; |
| 69 | + Authorship committer; |
| 70 | + String message; |
| 71 | + Tree tree; |
| 72 | + String url; |
| 73 | + int comment_count; |
| 74 | + |
| 75 | + public Authorship getAuthor() { |
| 76 | + return author; |
| 77 | + } |
| 78 | + |
| 79 | + public Authorship getCommitter() { |
| 80 | + return committer; |
| 81 | + } |
| 82 | + |
| 83 | + public String getMessage() { |
| 84 | + return message; |
| 85 | + } |
| 86 | + |
| 87 | + public URL getUrl() { |
| 88 | + return GitHub.parseURL(url); |
| 89 | + } |
| 90 | + |
| 91 | + public int getComment_count() { |
| 92 | + return comment_count; |
| 93 | + } |
| 94 | + } |
| 95 | + |
| 96 | + public static class CommitPointer { |
| 97 | + String sha; |
| 98 | + String url; |
| 99 | + String html_url; |
| 100 | + |
| 101 | + public URL getUrl() { |
| 102 | + return GitHub.parseURL(url); |
| 103 | + } |
| 104 | + |
| 105 | + public URL getHtml_url() { |
| 106 | + return GitHub.parseURL(html_url); |
| 107 | + } |
| 108 | + |
| 109 | + public String getSha() { |
| 110 | + return sha; |
| 111 | + } |
| 112 | + } |
| 113 | + |
| 114 | + String sha; |
| 115 | + Commit commit; |
| 116 | + String url; |
| 117 | + String html_url; |
| 118 | + String comments_url; |
| 119 | + CommitPointer[] parents; |
| 120 | + |
| 121 | + public String getSha() { |
| 122 | + return sha; |
| 123 | + } |
| 124 | + public Commit getCommit() { |
| 125 | + return commit; |
| 126 | + } |
| 127 | + public URL getApiUrl() { |
| 128 | + return GitHub.parseURL(url); |
| 129 | + } |
| 130 | + public URL getUrl() { |
| 131 | + return GitHub.parseURL(html_url); |
| 132 | + } |
| 133 | + public URL getCommentsUrl() { |
| 134 | + return GitHub.parseURL(comments_url); |
| 135 | + } |
| 136 | + public CommitPointer[] getParents() { |
| 137 | + return parents; |
| 138 | + } |
| 139 | +} |
0 commit comments