public abstract class AbstractConfigurationBuilder<T extends Configuration> extends Object implements Configuration.Builder<T>
Configuration.Builder
s.Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractConfigurationBuilder.Param
A single application parameter supported by this builder.
|
Constructor and Description |
---|
AbstractConfigurationBuilder() |
Modifier and Type | Method and Description |
---|---|
T |
build(String[] args)
Builds the
Configuration from the given command-line arguments. |
protected abstract T |
build0(T config)
Called by
build(String[]) after verifying that all required options have been set. |
protected abstract Collection<AbstractConfigurationBuilder.Param> |
getParams()
Returns the valid parameters supported by the configuration.
|
protected abstract T |
newConfiguration()
Creates a new configuration instance which will be used as the target for command-line
arguments.
|
void |
printUsage()
Prints the command-line usage for the application based on the options supported by this
builder.
|
public final T build(String[] args)
Configuration.Builder
Configuration
from the given command-line arguments.build
in interface Configuration.Builder<T extends Configuration>
public final void printUsage()
Configuration.Builder
printUsage
in interface Configuration.Builder<T extends Configuration>
protected abstract T newConfiguration()
protected abstract Collection<AbstractConfigurationBuilder.Param> getParams()
protected abstract T build0(T config)
build(String[])
after verifying that all required options have been set.
Performs any final validation and modifications to the configuration. If successful, returns
the fully built configuration.