Skip to content

Commit 3ef5cd0

Browse files
committed
Javadoc
1 parent 7d1ca3c commit 3ef5cd0

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

src/main/java/org/apache/commons/cli/Option.java

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
4343
public class Option implements Cloneable, Serializable {
4444

4545
/**
46-
* A nested builder class to create {@code Option} instances using descriptive methods.
46+
* Builds {@code Option} instances using descriptive methods.
4747
* <p>
4848
* Example usage:
4949
* </p>
@@ -122,6 +122,7 @@ public Option build() {
122122

123123
/**
124124
* Sets the converter for the option.
125+
*
125126
* <p>Note: see {@link TypeHandler} for serialization discussion.</p>
126127
* @param converter the Converter to use.
127128
* @return this builder, to allow method chaining.
@@ -144,7 +145,7 @@ public Builder desc(final String description) {
144145
}
145146

146147
/**
147-
* Indicates that the Option will require an argument.
148+
* Tests whether the Option will require an argument.
148149
*
149150
* @return this builder, to allow method chaining
150151
*/
@@ -153,7 +154,7 @@ public Builder hasArg() {
153154
}
154155

155156
/**
156-
* Indicates if the Option has an argument or not.
157+
* Tests whether the Option has an argument or not.
157158
*
158159
* @param hasArg specifies whether the Option takes an argument or not
159160
* @return this builder, to allow method chaining
@@ -165,7 +166,7 @@ public Builder hasArg(final boolean hasArg) {
165166
}
166167

167168
/**
168-
* Indicates that the Option can have unlimited argument values.
169+
* Tests whether the Option can have unlimited argument values.
169170
*
170171
* @return this builder, to allow method chaining
171172
*/
@@ -424,7 +425,7 @@ public Option(final String option, final String longOption, final boolean hasArg
424425
}
425426

426427
/**
427-
* Tells if the option can accept more arguments.
428+
* Tests whether the option can accept more arguments.
428429
*
429430
* @return false if the maximum number of arguments is reached
430431
* @since 1.3
@@ -434,7 +435,7 @@ boolean acceptsArg() {
434435
}
435436

436437
/**
437-
* Add the value to this Option. If the number of arguments is greater than zero and there is enough space in the list
438+
* Adds the value to this Option. If the number of arguments is greater than zero and there is enough space in the list
438439
* then add the value. Otherwise, throw a runtime exception.
439440
*
440441
* @param value The value to be added to this Option
@@ -477,7 +478,7 @@ void addValueForProcessing(final String value) {
477478
}
478479

479480
/**
480-
* Clear the Option values. After a parse is complete, these are left with data in them and they need clearing if
481+
* Clears the Option values. After a parse is complete, these are left with data in them and they need clearing if
481482
* another parse is done.
482483
*
483484
* See: <a href="https://issues.apache.org/jira/browse/CLI-71">CLI-71</a>
@@ -487,8 +488,8 @@ void clearValues() {
487488
}
488489

489490
/**
490-
* A rather odd clone method - due to incorrect code in 1.0 it is public and in 1.1 rather than throwing a
491-
* CloneNotSupportedException it throws a RuntimeException so as to maintain backwards compat at the API level.
491+
* A rather odd clone method - due to incorrect code in 1.0 it is public and in 1.1 rather than throwing a CloneNotSupportedException it throws a
492+
* RuntimeException so as to maintain backwards compatible at the API level.
492493
*
493494
* After calling this method, it is very likely you will want to call clearValues().
494495
*
@@ -546,6 +547,7 @@ public int getArgs() {
546547

547548
/**
548549
* Gets the value to type converter.
550+
*
549551
* @return the value to type converter
550552
* @since 1.7.0
551553
*/
@@ -677,7 +679,7 @@ public List<String> getValuesList() {
677679
}
678680

679681
/**
680-
* Query to see if this Option requires an argument
682+
* Tests whether this Option requires an argument
681683
*
682684
* @return boolean flag indicating if an argument is required
683685
*/
@@ -686,7 +688,7 @@ public boolean hasArg() {
686688
}
687689

688690
/**
689-
* Returns whether the display name for the argument value has been set.
691+
* Tests whether the display name for the argument value has been set.
690692
*
691693
* @return if the display name for the argument value has been set.
692694
*/
@@ -695,7 +697,7 @@ public boolean hasArgName() {
695697
}
696698

697699
/**
698-
* Query to see if this Option can take many values.
700+
* Tests whether this Option can take many values.
699701
*
700702
* @return boolean flag indicating if multiple values are allowed
701703
*/
@@ -709,7 +711,7 @@ public int hashCode() {
709711
}
710712

711713
/**
712-
* Query to see if this Option has a long name
714+
* Tests whether this Option has a long name
713715
*
714716
* @return boolean flag indicating existence of a long name
715717
*/
@@ -718,7 +720,7 @@ public boolean hasLongOpt() {
718720
}
719721

720722
/**
721-
* Returns whether this Option has any values.
723+
* Tests whether this Option has any values.
722724
*
723725
* @return whether this Option has any values.
724726
*/
@@ -727,7 +729,7 @@ private boolean hasNoValues() {
727729
}
728730

729731
/**
730-
* Returns whether this Option can have an optional argument.
732+
* Tests whether this Option can have an optional argument.
731733
*
732734
* @return whether this Option can have an optional argument
733735
*/
@@ -736,7 +738,7 @@ public boolean hasOptionalArg() {
736738
}
737739

738740
/**
739-
* Return whether this Option has specified a value separator.
741+
* Tests whether this Option has specified a value separator.
740742
*
741743
* @return whether this Option has specified a value separator.
742744
* @since 1.1
@@ -746,7 +748,7 @@ public boolean hasValueSeparator() {
746748
}
747749

748750
/**
749-
* Query to see if this Option is mandatory
751+
* Tests whether this Option is required.
750752
*
751753
* @return boolean flag indicating whether this Option is mandatory
752754
*/
@@ -796,7 +798,7 @@ private void processValue(final String value) {
796798
}
797799

798800
/**
799-
* Tells if the option requires more arguments to be valid.
801+
* Tests whether the option requires more arguments to be valid.
800802
*
801803
* @return false if the option doesn't require more arguments
802804
* @since 1.3
@@ -910,9 +912,9 @@ public void setValueSeparator(final char sep) {
910912
}
911913

912914
/**
913-
* Dump state, suitable for debugging.
915+
* Creates a String suitable for debugging.
914916
*
915-
* @return Stringified form of this object
917+
* @return a String suitable for debugging.
916918
*/
917919
@Override
918920
public String toString() {

0 commit comments

Comments
 (0)