- java.lang.Object
-
- Apache.CLI.CommandLine.Builder
-
- Enclosing class:
- CommandLine
public static final class CommandLine.Builder extends java.lang.Object
This Class-File has been copied, directly from the Apache Commons Software Foundation. Other than the minor, cosmetic changes (mentioned in the second-list below), this file is perfectly identical to the original that may be found on the Apache Website:apache.org.- The suggested license for using this file may be read here:
Apache License - The Source-Code Header for this file may be viewed here:
Source-File Header - Partial contents of the
'site/resources/images'directory:Resource Images
Notes about changes that have been made as a result of the import process:- Within all files, the original Package-Name declaration has been changed:
Original: package org.apache.commons.cli;Updated: package Apache.CLI;
- All Classes and Class-Members (Methods, Fields, etc...) that were previously Annotated
with the
@DeprecatedAnnotation have been summarily removed.
- Code Formattings and Styling has been heavily modified to conform to the Standard Java-HTML
Indentation & Styling Choices. The code itself remains identical, with only a few
squiggly-braces
'{' and '}'being removed, for cosmetic reasons (and for lowering "Developer Stress" Levels)..
A nested builder class to createCommandLineinstance using descriptive methods.
Hi-Lited Source-Code:- View Here: Apache/CLI/CommandLine.java
- Open New Browser-Tab: Apache/CLI/CommandLine.java
File Size: 1,199 Bytes Line Count: 36 '\n' Characters Found
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandLine.BuilderaddArg(String arg)Adds left-over unrecognized option/argument.CommandLine.BuilderaddOption(Option opt)Adds an option to the command line.CommandLinebuild()Returns the new instance.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
addArg
public CommandLine.Builder addArg(java.lang.String arg)
Adds left-over unrecognized option/argument.- Parameters:
arg- the unrecognized option/argument.- Returns:
- this Builder instance for method chaining.
- Code:
- Exact Method Body:
commandLine.addArg(arg); return this;
-
addOption
public CommandLine.Builder addOption(Option opt)
Adds an option to the command line. The values of the option are stored.- Parameters:
opt- the processed option.- Returns:
- this Builder instance for method chaining.
- Code:
- Exact Method Body:
commandLine.addOption(opt); return this;
-
build
public CommandLine build()
Returns the new instance.- Returns:
- the new instance.
- Code:
- Exact Method Body:
return commandLine;
-
-