|
24 | 24 | * according to the definition supplied to the parser. |
25 | 25 | */ |
26 | 26 | public interface CommandLine { |
27 | | - |
| 27 | + |
28 | 28 | /** |
29 | | - * Detects the presence of an option with the specified trigger in this |
| 29 | + * Detects the presence of an option with the specified trigger in this |
30 | 30 | * CommandLine. |
31 | | - * |
| 31 | + * |
32 | 32 | * @param trigger the trigger to search for |
33 | 33 | * @return true iff an option with this trigger is present |
34 | 34 | */ |
35 | 35 | boolean hasOption(final String trigger); |
36 | | - |
| 36 | + |
37 | 37 | /** |
38 | 38 | * Detects the presence of an option in this CommandLine. |
39 | | - * |
| 39 | + * |
40 | 40 | * @param option the Option to search for |
41 | 41 | * @return true iff the option is present |
42 | 42 | */ |
43 | 43 | boolean hasOption(final Option option); |
44 | | - |
| 44 | + |
45 | 45 | /** |
46 | 46 | * Finds the Option with the specified trigger |
47 | | - * |
| 47 | + * |
48 | 48 | * @param trigger the name of the option to retrieve |
49 | 49 | * @return the Option matching the trigger or null if none exists |
50 | 50 | */ |
51 | 51 | Option getOption(final String trigger); |
52 | | - |
| 52 | + |
53 | 53 | /** |
54 | 54 | * Retrieves the Argument values associated with the specified Option |
55 | | - * |
| 55 | + * |
56 | 56 | * @param trigger a trigger used to lookup the Option |
57 | 57 | * @return a list of values or an empty List if none are found |
58 | 58 | */ |
59 | 59 | List getValues(final String trigger); |
60 | | - |
| 60 | + |
61 | 61 | /** |
62 | 62 | * Retrieves the Argument values associated with the specified Option |
63 | | - * |
| 63 | + * |
64 | 64 | * @param trigger a trigger used to lookup the Option |
65 | 65 | * @param defaultValues the result to return if no values are found |
66 | 66 | * @return a list of values or defaultValues if none are found |
67 | 67 | */ |
68 | 68 | List getValues(final String trigger, final List defaultValues); |
69 | | - |
| 69 | + |
70 | 70 | /** |
71 | 71 | * Retrieves the Argument values associated with the specified Option |
72 | | - * |
| 72 | + * |
73 | 73 | * @param option the Option associated with the values |
74 | 74 | * @return a list of values or an empty List if none are found |
75 | 75 | */ |
76 | 76 | List getValues(final Option option); |
77 | | - |
| 77 | + |
78 | 78 | /** |
79 | 79 | * Retrieves the Argument values associated with the specified Option |
80 | | - * |
| 80 | + * |
81 | 81 | * @param option the Option associated with the values |
82 | 82 | * @param defaultValues the result to return if no values are found |
83 | 83 | * @return a list of values or defaultValues if none are found |
84 | 84 | */ |
85 | 85 | List getValues(final Option option, final List defaultValues); |
86 | | - |
| 86 | + |
87 | 87 | /** |
88 | 88 | * Retrieves the single Argument value associated with the specified Option |
89 | | - * |
| 89 | + * |
90 | 90 | * @param trigger a trigger used to lookup the Option |
91 | 91 | * @return the matching value or null if none exists |
92 | 92 | * @throws IllegalStateException if more than one values are found |
93 | 93 | */ |
94 | 94 | Object getValue(final String trigger) throws IllegalStateException; |
95 | | - |
| 95 | + |
96 | 96 | /** |
97 | 97 | * Retrieves the single Argument value associated with the specified Option |
98 | | - * |
| 98 | + * |
99 | 99 | * @param trigger a trigger used to lookup the Option |
100 | 100 | * @param defaultValue the result to use if no values are found |
101 | 101 | * @return the matching value or defaultValue if none exists |
102 | 102 | * @throws IllegalStateException if more than one values are found |
103 | 103 | */ |
104 | 104 | Object getValue(final String trigger, final Object defaultValue) throws IllegalStateException; |
105 | | - |
| 105 | + |
106 | 106 | /** |
107 | 107 | * Retrieves the single Argument value associated with the specified Option |
108 | | - * |
| 108 | + * |
109 | 109 | * @param option the Option associated with the value |
110 | 110 | * @return the matching value or null if none exists |
111 | 111 | * @throws IllegalStateException if more than one values are found |
112 | 112 | */ |
113 | 113 | Object getValue(final Option option) throws IllegalStateException; |
114 | | - |
| 114 | + |
115 | 115 | /** |
116 | 116 | * Retrieves the single Argument value associated with the specified Option |
117 | | - * |
| 117 | + * |
118 | 118 | * @param option the Option associated with the value |
119 | 119 | * @param defaultValue the result to use if no values are found |
120 | 120 | * @return the matching value or defaultValue if none exists |
121 | 121 | * @throws IllegalStateException if more than one values are found |
122 | 122 | */ |
123 | 123 | Object getValue(final Option option, final Object defaultValue) throws IllegalStateException; |
124 | | - |
| 124 | + |
125 | 125 | /** |
126 | 126 | * Retrieves the Boolean value associated with the specified Switch |
127 | | - * |
| 127 | + * |
128 | 128 | * @param trigger a trigger used to lookup the Option |
129 | 129 | * @return the Boolean associated with trigger or null if none exists |
130 | 130 | */ |
131 | 131 | Boolean getSwitch(final String trigger); |
132 | | - |
| 132 | + |
133 | 133 | /** |
134 | 134 | * Retrieves the Boolean value associated with the specified Switch |
135 | | - * |
| 135 | + * |
136 | 136 | * @param trigger a trigger used to lookup the Option |
137 | 137 | * @param defaultValue the Boolean to use if none match |
138 | 138 | * @return the Boolean associated with trigger or defaultValue if none exists |
139 | 139 | */ |
140 | 140 | Boolean getSwitch(final String trigger, final Boolean defaultValue); |
141 | | - |
| 141 | + |
142 | 142 | /** |
143 | 143 | * Retrieves the Boolean value associated with the specified Switch |
144 | | - * |
| 144 | + * |
145 | 145 | * @param option the Option associated with the value |
146 | 146 | * @return the Boolean associated with option or null if none exists |
147 | 147 | */ |
148 | 148 | Boolean getSwitch(final Option option); |
149 | | - |
| 149 | + |
150 | 150 | /** |
151 | 151 | * Retrieves the Boolean value associated with the specified Switch |
152 | | - * |
| 152 | + * |
153 | 153 | * @param option the Option associated with the value |
154 | 154 | * @param defaultValue the Boolean to use if none match |
155 | 155 | * @return the Boolean associated with option or defaultValue if none exists |
156 | 156 | */ |
157 | 157 | Boolean getSwitch(final Option option, final Boolean defaultValue); |
158 | | - |
159 | | - |
| 158 | + |
| 159 | + |
160 | 160 | /** |
161 | | - * Retrieves the value associated with the specified property |
162 | | - * |
| 161 | + * Retrieves the value associated with the specified property |
| 162 | + * |
163 | 163 | * @param property the property name to lookup |
164 | 164 | * @return the value of the property or null |
165 | 165 | */ |
166 | 166 | String getProperty(final String property); |
167 | | - |
| 167 | + |
168 | 168 | /** |
169 | | - * Retrieves the value associated with the specified property |
170 | | - * |
| 169 | + * Retrieves the value associated with the specified property |
| 170 | + * |
171 | 171 | * @param property the property name to lookup |
172 | 172 | * @param defaultValue the value to use if no other is found |
173 | 173 | * @return the value of the property or defaultValue |
174 | 174 | */ |
175 | 175 | String getProperty(final String property, final String defaultValue); |
176 | | - |
| 176 | + |
177 | 177 | /** |
178 | 178 | * Retrieves the set of all property names associated with this CommandLine |
179 | | - * |
180 | | - * @return a none null set of property names |
| 179 | + * |
| 180 | + * @return a none null set of property names |
181 | 181 | */ |
182 | 182 | Set getProperties(); |
183 | | - |
| 183 | + |
184 | 184 | /** |
185 | | - * Retrieves the number of times the specified Option appeared in this |
| 185 | + * Retrieves the number of times the specified Option appeared in this |
186 | 186 | * CommandLine |
187 | | - * |
| 187 | + * |
188 | 188 | * @param trigger a trigger used to lookup the Option |
189 | 189 | * @return the number of occurrences of the option |
190 | 190 | */ |
191 | 191 | int getOptionCount(final String trigger); |
192 | | - |
| 192 | + |
193 | 193 | /** |
194 | | - * Retrieves the number of times the specified Option appeared in this |
| 194 | + * Retrieves the number of times the specified Option appeared in this |
195 | 195 | * CommandLine |
196 | | - * |
| 196 | + * |
197 | 197 | * @param option the Option associated to check |
198 | 198 | * @return the number of occurrences of the option |
199 | 199 | */ |
200 | 200 | int getOptionCount(final Option option); |
201 | | - |
| 201 | + |
202 | 202 | /** |
203 | 203 | * Retrieves a list of all Options found in this CommandLine |
204 | | - * |
| 204 | + * |
205 | 205 | * @return a none null list of Options |
206 | 206 | */ |
207 | 207 | List getOptions(); |
208 | | - |
| 208 | + |
209 | 209 | /** |
210 | 210 | * Retrieves a list of all Option triggers found in this CommandLine |
211 | | - * |
| 211 | + * |
212 | 212 | * @return a none null list of Option triggers |
213 | 213 | */ |
214 | 214 | Set getOptionTriggers(); |
|
0 commit comments