C
- Command typepublic class CliBuilder<C> extends AbstractBuilder<Cli<C>>
Modifier and Type | Field and Description |
---|---|
protected Class<? extends C> |
defaultCommand |
protected List<Class<? extends C>> |
defaultCommandGroupCommands |
protected String |
description |
protected Map<String,GroupBuilder<C>> |
groups |
protected String |
name |
protected String |
optionSeparators |
protected ParserBuilder<C> |
parserBuilder |
protected List<GlobalRestriction> |
restrictions |
Constructor and Description |
---|
CliBuilder(String name) |
Modifier and Type | Method and Description |
---|---|
Cli<C> |
build()
Builds the type
|
GroupBuilder<C> |
getGroup(String name) |
CliBuilder<C> |
withCommand(Class<? extends C> command) |
CliBuilder<C> |
withCommands(Class<? extends C> command,
Class<? extends C>... moreCommands) |
CliBuilder<C> |
withCommands(Iterable<Class<? extends C>> commands) |
CliBuilder<C> |
withDefaultCommand(Class<? extends C> defaultCommand) |
CliBuilder<C> |
withDefaultRestrictions() |
CliBuilder<C> |
withDescription(String description) |
GroupBuilder<C> |
withGroup(String name) |
CliBuilder<C> |
withNoRestrictions() |
CliBuilder<C> |
withOnlyDefaultRestrictions() |
ParserBuilder<C> |
withParser() |
CliBuilder<C> |
withRestriction(GlobalRestriction restriction) |
CliBuilder<C> |
withRestrictions(GlobalRestriction... restrictions) |
checkNotBlank, checkNotEmpty, checkNotNull
protected final String name
protected String description
protected String optionSeparators
protected final Map<String,GroupBuilder<C>> groups
protected final List<GlobalRestriction> restrictions
protected final ParserBuilder<C> parserBuilder
public CliBuilder(String name)
public CliBuilder<C> withDescription(String description)
public CliBuilder<C> withDefaultCommand(Class<? extends C> defaultCommand)
public CliBuilder<C> withCommand(Class<? extends C> command)
public CliBuilder<C> withCommands(Class<? extends C> command, Class<? extends C>... moreCommands)
public CliBuilder<C> withCommands(Iterable<Class<? extends C>> commands)
public GroupBuilder<C> withGroup(String name)
public GroupBuilder<C> getGroup(String name)
public CliBuilder<C> withRestriction(GlobalRestriction restriction)
public CliBuilder<C> withRestrictions(GlobalRestriction... restrictions)
public CliBuilder<C> withNoRestrictions()
public CliBuilder<C> withDefaultRestrictions()
public CliBuilder<C> withOnlyDefaultRestrictions()
public ParserBuilder<C> withParser()
public Cli<C> build()
AbstractBuilder
build
in class AbstractBuilder<Cli<C>>
Copyright © 2012–2017. All rights reserved.