Skip to content

Commit a9edab0

Browse files
committed
javadoc
1 parent 106bba0 commit a9edab0

File tree

3 files changed

+8
-37
lines changed

3 files changed

+8
-37
lines changed

jbock/src/main/java/net/jbock/parse/AbstractParser.java

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,7 @@ private String readOptionName(String token) {
114114
return token.substring(0, token.indexOf('='));
115115
}
116116

117-
/**
118-
* Returns the arguments of the given option.
119-
* If the option was not present on the command line,
120-
* an empty stream is returned. If the option is not
121-
* repeatable, the stream will contain exactly one element.
122-
* For nullary options, an empty stream
123-
* represents absence, and any nonempty stream represents presence
124-
* of the option.
125-
*
126-
* <p>This method should be not be invoked before {@link #parse(List)}
127-
* was invoked.
128-
*
129-
* @param option the option key
130-
* @return a stream of strings
131-
*/
117+
@Override
132118
public final Stream<String> option(T option) {
133119
OptionState optionState = optionStates.get(option);
134120
if (optionState == null) {
@@ -137,16 +123,7 @@ public final Stream<String> option(T option) {
137123
return optionState.stream();
138124
}
139125

140-
/**
141-
* Returns the value of the positional parameter at the given position,
142-
* if any.
143-
*
144-
* <p>This method should be not be invoked before {@link #parse(List)}
145-
* was invoked.
146-
*
147-
* @param index the parameter position
148-
* @return an optional string
149-
*/
126+
@Override
150127
public final Optional<String> param(int index) {
151128
if (index < 0 || index >= params.length) {
152129
return Optional.empty();

jbock/src/main/java/net/jbock/parse/ParseResult.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ public interface ParseResult<T> {
1414
* Get all option values for the given option key,
1515
* in the order in which they were passed on the command line.
1616
*
17-
* <p>For a non-repeatable option, the stream will not contain more than
18-
* one element.
19-
*
20-
* <p>For a required option, the stream will contain exactly one element.
21-
*
2217
* @param optionKey a key that represents a named option
2318
* @return stream of tokens
2419
*/
@@ -40,10 +35,9 @@ public interface ParseResult<T> {
4035

4136
/**
4237
* Returns the remaining tokens.
43-
*
44-
* <p>This stream may be nonempty if there is a {@linkplain net.jbock.VarargsParameter},
45-
* or if the command is a {@linkplain net.jbock.SuperCommand}.
46-
* Otherwise it will be an empty stream.
38+
* This can be nonempty if there is a varargs parameter,
39+
* or if this is a supercommand where parsing stops after the
40+
* last positional parameter was read.
4741
*
4842
* @return remaining tokens
4943
*/

jbock/src/main/java/net/jbock/parse/VarargsParameterParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import java.util.stream.Stream;
77

88
/**
9-
* Mutable command line parser that allows additional
10-
* non-option tokens after the last positional parameter.
11-
* This parser rejects suspicious tokens, and allows
9+
* Mutable command line parser that allows an arbitrary number of additional
10+
* tokens after the last positional parameter.
11+
* The parser rejects unknown option-like tokens, and recognizes
1212
* double-dash escape.
1313
*
1414
* @param <T> type of keys that identify named options

0 commit comments

Comments
 (0)