forked from hub4j/github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitUser.java
More file actions
60 lines (52 loc) · 1.59 KB
/
GitUser.java
File metadata and controls
60 lines (52 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package org.kohsuke.github;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Date;
import javax.annotation.CheckForNull;
/**
* Represents a user in Git who authors/commits a commit.
* <p>
* In contrast, {@link GHUser} is an user of GitHub. Because Git allows a person to use multiple e-mail addresses and
* names when creating a commit, there's generally no meaningful mapping between {@link GHUser} and {@link GitUser}.
*
* @author Kohsuke Kawaguchi
*/
@SuppressFBWarnings(value = { "UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD", "UWF_UNWRITTEN_FIELD", "NP_UNWRITTEN_FIELD" },
justification = "JSON API")
public class GitUser {
private String name, email, date, username;
/**
* Gets the git user name for an author or committer on a git commit.
*
* @return Human readable name of the user, such as "Kohsuke Kawaguchi"
*/
public String getName() {
return name;
}
/**
* Gets the git email for an author or committer on a git commit.
*
* @return E-mail address, such as "foo@example.com"
*/
public String getEmail() {
return email;
}
/**
* Gets username. Note: it presents only in events.
*
* @return GitHub username
*/
@Preview
@Deprecated
@CheckForNull
public String getUsername() {
return username;
}
/**
* Gets date.
*
* @return This field doesn't appear to be consistently available in all the situations where this class is used.
*/
public Date getDate() {
return GitHubClient.parseDate(date);
}
}