StateValues.java
1.89 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package pl.itcrowd.youtrack.api.defaults;
public enum StateValues {
Submitted,
Open,
InProgress("{In Progress}", "In Progress"),
ToBeDiscussed("{To be discussed}", "To be discussed"),
Reopened,
CantReproduce("{Can't Reproduce}", "Can't Reproduce"),
Duplicate,
Fixed,
WontFix("{Won't fix}", "Won't fix"),
Incomplete,
Obsolete,
Verified,
New,
NotSubmitted(true, Submitted),
NotOpen(true, Open),
NotInProgress(true, InProgress),
NotToBeDiscussed(true, ToBeDiscussed),
NotReopened(true, Reopened),
NotCantReproduce(true, CantReproduce),
NotDuplicate(true, Duplicate),
NotFixed(true, Fixed),
NotWontFix(true, WontFix),
NotIncomplete(true, Incomplete),
NotObsolete(true, Open),
NotVerified(true, Verified),
NotNew(true, New),
Resolved("Resolved", null),
Unresolved("Unresolved", null);
private String commandValue;
private String filterValue;
private boolean not;
private StateValues()
{
this(false);
}
private StateValues(boolean not)
{
this(not, null, null);
}
private StateValues(String filterValue, String commandValue)
{
this(false, filterValue, commandValue);
}
private StateValues(boolean not, StateValues value)
{
this(not, value.getFilterValue(), value.getCommandValue());
}
private StateValues(boolean not, String filterValue, String commandValue)
{
this.not = not;
this.filterValue = filterValue == null ? name() : filterValue;
this.commandValue = commandValue == null ? name() : commandValue;
}
@Override
public String toString()
{
return getCommandValue();
}
public String getCommandValue()
{
return (not ? "-" : "") + commandValue;
}
public String getFilterValue()
{
return (not ? "-" : "") + filterValue;
}
}