1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.eluder.coveralls.maven.plugin.domain;
25
26 import java.io.File;
27 import java.io.Serializable;
28 import java.util.List;
29
30 import com.fasterxml.jackson.annotation.JsonIgnore;
31 import com.fasterxml.jackson.annotation.JsonProperty;
32
33 public class Git implements JsonObject {
34
35 private static final long serialVersionUID = 1L;
36
37 @JsonIgnore
38 private final File baseDir;
39
40 @JsonProperty("head")
41 private final Head head;
42
43 @JsonProperty("branch")
44 private final String branch;
45
46 @JsonProperty("remotes")
47 private final List<Remote> remotes;
48
49 public Git(final File baseDir, final Head head, final String branch, final List<Remote> remotes) {
50 this.baseDir = baseDir;
51 this.head = head;
52 this.branch = branch;
53 this.remotes = remotes;
54 }
55
56 public File getBaseDir() {
57 return baseDir;
58 }
59
60 public Head getHead() {
61 return head;
62 }
63
64 public String getBranch() {
65 return branch;
66 }
67
68 public List<Remote> getRemotes() {
69 return remotes;
70 }
71
72 public static class Head implements Serializable {
73 private static final long serialVersionUID = 1L;
74
75 @JsonProperty("id")
76 private final String id;
77
78 @JsonProperty("author_name")
79 private final String authorName;
80
81 @JsonProperty("author_email")
82 private final String authorEmail;
83
84 @JsonProperty("committer_name")
85 private final String committerName;
86
87 @JsonProperty("committer_email")
88 private final String committerEmail;
89
90 @JsonProperty("message")
91 private final String message;
92
93 public Head(final String id, final String authorName, final String authorEmail, final String committerName, final String committerEmail, final String message) {
94 this.id = id;
95 this.authorName = authorName;
96 this.authorEmail = authorEmail;
97 this.committerName = committerName;
98 this.committerEmail = committerEmail;
99 this.message = message;
100 }
101
102 public String getId() {
103 return id;
104 }
105
106 public String getAuthorName() {
107 return authorName;
108 }
109
110 public String getAuthorEmail() {
111 return authorEmail;
112 }
113
114 public String getCommitterName() {
115 return committerName;
116 }
117
118 public String getCommitterEmail() {
119 return committerEmail;
120 }
121
122 public String getMessage() {
123 return message;
124 }
125 }
126
127 public static class Remote implements Serializable {
128 private static final long serialVersionUID = 1L;
129
130 @JsonProperty("name")
131 private final String name;
132
133 @JsonProperty("url")
134 private final String url;
135
136 public Remote(final String name, final String url) {
137 this.name = name;
138 this.url = url;
139 }
140
141 public String getName() {
142 return name;
143 }
144
145 public String getUrl() {
146 return url;
147 }
148 }
149 }