1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.cli2;
18
19 import java.util.Collections;
20 import java.util.HashSet;
21 import java.util.Set;
22
23
24
25
26
27
28
29 public class DisplaySetting {
30
31 private static final Set all = new HashSet();
32
33
34
35
36 public static final Set ALL = Collections.unmodifiableSet(all);
37
38
39
40
41 public static final Set NONE = Collections.EMPTY_SET;
42
43
44
45
46 public static final DisplaySetting DISPLAY_ALIASES =
47 new DisplaySetting("DISPLAY_ALIASES");
48
49
50
51
52 public static final DisplaySetting DISPLAY_OPTIONAL =
53 new DisplaySetting("DISPLAY_OPTIONAL");
54
55
56
57
58
59 public static final DisplaySetting DISPLAY_OPTIONAL_CHILD_GROUP =
60 new DisplaySetting("DISPLAY_OPTIONAL_CHILD_GROUP");
61
62
63
64
65 public static final DisplaySetting DISPLAY_PROPERTY_OPTION =
66 new DisplaySetting("DISPLAY_PROPERTY_OPTION");
67
68
69
70
71 public static final DisplaySetting DISPLAY_SWITCH_ENABLED =
72 new DisplaySetting("DISPLAY_SWITCH_ENABLED");
73
74
75
76
77 public static final DisplaySetting DISPLAY_SWITCH_DISABLED =
78 new DisplaySetting("DISPLAY_SWITCH_DISABLED");
79
80
81
82
83 public static final DisplaySetting DISPLAY_GROUP_NAME =
84 new DisplaySetting("DISPLAY_GROUP_NAME");
85
86
87
88
89 public static final DisplaySetting DISPLAY_GROUP_EXPANDED =
90 new DisplaySetting("DISPLAY_GROUP_EXPANDED");
91
92
93
94
95 public static final DisplaySetting DISPLAY_GROUP_ARGUMENT =
96 new DisplaySetting("DISPLAY_GROUP_ARGUMENT");
97
98
99
100
101 public static final DisplaySetting DISPLAY_GROUP_OUTER =
102 new DisplaySetting("DISPLAY_GROUP_OUTER");
103
104
105
106
107 public static final DisplaySetting DISPLAY_ARGUMENT_NUMBERED =
108 new DisplaySetting("DISPLAY_ARGUMENT_NUMBERED");
109
110
111
112
113 public static final DisplaySetting DISPLAY_ARGUMENT_BRACKETED =
114 new DisplaySetting("DISPLAY_ARGUMENT_BRACKETED");
115
116
117
118
119 public static final DisplaySetting DISPLAY_PARENT_ARGUMENT =
120 new DisplaySetting("DISPLAY_PARENT_ARGUMENT");
121
122
123
124
125 public static final DisplaySetting DISPLAY_PARENT_CHILDREN =
126 new DisplaySetting("DISPLAY_PARENT_CHILDREN");
127
128
129
130
131 private final String name;
132
133
134
135
136 private final int hashCode;
137
138
139
140
141
142 private DisplaySetting(final String name) {
143 this.name = name;
144 this.hashCode = name.hashCode();
145 all.add(this);
146 }
147
148 public int hashCode() {
149 return hashCode;
150 }
151
152 public boolean equals(final Object that) {
153 if (that instanceof DisplaySetting) {
154 return name.compareTo(that.toString()) == 0;
155 }
156 return false;
157 }
158
159 public String toString() {
160 return name;
161 }
162 }