blob: 52c022bebdf3853ca911b4b33a006f64255d3b2f (
plain) (
blame)
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
61
62
63
64
65
|
package com.yahoo.vespa.hosted.controller.api.integration.organization;
import com.yahoo.vespa.hosted.controller.api.integration.organization.IssueId;
import com.yahoo.vespa.hosted.controller.api.integration.organization.User;
import java.time.Instant;
import java.util.Optional;
/**
* Information about a stored issue.
*
* @author jonmv
*/
public class IssueInfo {
private final IssueId id;
private final Instant updated;
private final Status status;
private final User assignee;
public IssueInfo(IssueId id, Instant updated, Status status, User assignee) {
this.id = id;
this.updated = updated;
this.status = status;
this.assignee = assignee;
}
public IssueId id() {
return id;
}
public Instant updated() {
return updated;
}
public Status status() {
return status;
}
public Optional<User> assignee() {
return Optional.ofNullable(assignee);
}
public enum Status {
toDo("To Do"),
inProgress("In Progress"),
done("Done"),
noCategory("No Category");
private final String value;
Status(String value) { this.value = value; }
public static Status fromValue(String value) {
for (Status status : Status.values())
if (status.value.equals(value))
return status;
throw new IllegalArgumentException(value + " is not a valid status.");
}
}
}
|