| 
1
 | 
1
 | 
 package pl.com.it_crowd.youtrack.api.defaults;
 | 
| 
2
 | 
2
 | 
 
 | 
| 
3
 | 
3
 | 
 public enum StateValues {
 | 
| 
4
 | 
 
 | 
-    Submitted, Open, InProgress("{In Progress}", "In Progress"), ToBeDiscussed("{To be discussed}", "To be discussed"), Reopened, CantReproduce(
 | 
| 
5
 | 
 
 | 
-        "{Can't Reproduce}", "Can't Reproduce"), Duplicate, Fixed, WontFix("{Won't fix}", "Won't fix"),
 | 
| 
6
 | 
 
 | 
-    Incomplete, Obsolete, Verified, New, Resolved("Resolved", null), Unresolved("Unresolved", null);
 | 
| 
 
 | 
4
 | 
+    Submitted,
 | 
| 
 
 | 
5
 | 
+    Open,
 | 
| 
 
 | 
6
 | 
+    InProgress("{In Progress}", "In Progress"),
 | 
| 
 
 | 
7
 | 
+    ToBeDiscussed("{To be discussed}", "To be discussed"),
 | 
| 
 
 | 
8
 | 
+    Reopened,
 | 
| 
 
 | 
9
 | 
+    CantReproduce("{Can't Reproduce}", "Can't Reproduce"),
 | 
| 
 
 | 
10
 | 
+    Duplicate,
 | 
| 
 
 | 
11
 | 
+    Fixed,
 | 
| 
 
 | 
12
 | 
+    WontFix("{Won't fix}", "Won't fix"),
 | 
| 
 
 | 
13
 | 
+    Incomplete,
 | 
| 
 
 | 
14
 | 
+    Obsolete,
 | 
| 
 
 | 
15
 | 
+    Verified,
 | 
| 
 
 | 
16
 | 
+    New,
 | 
| 
 
 | 
17
 | 
+    NotSubmitted(true, Submitted),
 | 
| 
 
 | 
18
 | 
+    NotOpen(true, Open),
 | 
| 
 
 | 
19
 | 
+    NotInProgress(true, InProgress),
 | 
| 
 
 | 
20
 | 
+    NotToBeDiscussed(true, ToBeDiscussed),
 | 
| 
 
 | 
21
 | 
+    NotReopened(true, Reopened),
 | 
| 
 
 | 
22
 | 
+    NotCantReproduce(true, CantReproduce),
 | 
| 
 
 | 
23
 | 
+    NotDuplicate(true, Duplicate),
 | 
| 
 
 | 
24
 | 
+    NotFixed(true, Fixed),
 | 
| 
 
 | 
25
 | 
+    NotWontFix(true, WontFix),
 | 
| 
 
 | 
26
 | 
+    NotIncomplete(true, Incomplete),
 | 
| 
 
 | 
27
 | 
+    NotObsolete(true, Open),
 | 
| 
 
 | 
28
 | 
+    NotVerified(true, Verified),
 | 
| 
 
 | 
29
 | 
+    NotNew(true, New),
 | 
| 
 
 | 
30
 | 
+    Resolved("Resolved", null),
 | 
| 
 
 | 
31
 | 
+    Unresolved("Unresolved", null);
 | 
| 
7
 | 
32
 | 
 
 | 
| 
8
 | 
33
 | 
 // ------------------------------ FIELDS ------------------------------
 | 
| 
9
 | 
34
 | 
 
 | 
| 
...
 | 
...
 | 
@@ -11,29 +36,54 @@ public enum StateValues { | 
| 
11
 | 
36
 | 
 
 | 
| 
12
 | 
37
 | 
     private String filterValue;
 | 
| 
13
 | 
38
 | 
 
 | 
| 
 
 | 
39
 | 
+    private boolean not;
 | 
| 
 
 | 
40
 | 
+
 | 
| 
14
 | 
41
 | 
 // --------------------------- CONSTRUCTORS ---------------------------
 | 
| 
15
 | 
42
 | 
 
 | 
| 
16
 | 
43
 | 
     private StateValues()
 | 
| 
17
 | 
44
 | 
     {
 | 
| 
18
 | 
 
 | 
-        filterValue = name();
 | 
| 
19
 | 
 
 | 
-        commandValue = name();
 | 
| 
 
 | 
45
 | 
+        this(false);
 | 
| 
 
 | 
46
 | 
+    }
 | 
| 
 
 | 
47
 | 
+
 | 
| 
 
 | 
48
 | 
+    private StateValues(boolean not)
 | 
| 
 
 | 
49
 | 
+    {
 | 
| 
 
 | 
50
 | 
+        this(not, null, null);
 | 
| 
20
 | 
51
 | 
     }
 | 
| 
21
 | 
52
 | 
 
 | 
| 
22
 | 
53
 | 
     private StateValues(String filterValue, String commandValue)
 | 
| 
23
 | 
54
 | 
     {
 | 
| 
24
 | 
 
 | 
-        this.filterValue = filterValue;
 | 
| 
25
 | 
 
 | 
-        this.commandValue = commandValue;
 | 
| 
 
 | 
55
 | 
+        this(false, filterValue, commandValue);
 | 
| 
 
 | 
56
 | 
+    }
 | 
| 
 
 | 
57
 | 
+
 | 
| 
 
 | 
58
 | 
+    private StateValues(boolean not, StateValues value)
 | 
| 
 
 | 
59
 | 
+    {
 | 
| 
 
 | 
60
 | 
+        this(not, value.getFilterValue(), value.getCommandValue());
 | 
| 
 
 | 
61
 | 
+    }
 | 
| 
 
 | 
62
 | 
+
 | 
| 
 
 | 
63
 | 
+    private StateValues(boolean not, String filterValue, String commandValue)
 | 
| 
 
 | 
64
 | 
+    {
 | 
| 
 
 | 
65
 | 
+        this.not = not;
 | 
| 
 
 | 
66
 | 
+        this.filterValue = filterValue == null ? name() : filterValue;
 | 
| 
 
 | 
67
 | 
+        this.commandValue = commandValue == null ? name() : commandValue;
 | 
| 
 
 | 
68
 | 
+    }
 | 
| 
 
 | 
69
 | 
+
 | 
| 
 
 | 
70
 | 
+// ------------------------ CANONICAL METHODS ------------------------
 | 
| 
 
 | 
71
 | 
+
 | 
| 
 
 | 
72
 | 
+    @Override
 | 
| 
 
 | 
73
 | 
+    public String toString()
 | 
| 
 
 | 
74
 | 
+    {
 | 
| 
 
 | 
75
 | 
+        return getCommandValue();
 | 
| 
26
 | 
76
 | 
     }
 | 
| 
27
 | 
77
 | 
 
 | 
| 
28
 | 
 
 | 
-// --------------------- GETTER / SETTER METHODS ---------------------
 | 
| 
 
 | 
78
 | 
+// -------------------------- OTHER METHODS --------------------------
 | 
| 
29
 | 
79
 | 
 
 | 
| 
30
 | 
80
 | 
     public String getCommandValue()
 | 
| 
31
 | 
81
 | 
     {
 | 
| 
32
 | 
 
 | 
-        return commandValue;
 | 
| 
 
 | 
82
 | 
+        return (not ? "-" : "") + commandValue;
 | 
| 
33
 | 
83
 | 
     }
 | 
| 
34
 | 
84
 | 
 
 | 
| 
35
 | 
85
 | 
     public String getFilterValue()
 | 
| 
36
 | 
86
 | 
     {
 | 
| 
37
 | 
 
 | 
-        return filterValue;
 | 
| 
 
 | 
87
 | 
+        return (not ? "-" : "") + filterValue;
 | 
| 
38
 | 
88
 | 
     }
 | 
| 
39
 | 
89
 | 
 } | 
...
 | 
...
 | 
 |