public class ServerPackCreator.CommandlineParser
extends java.lang.Object
CLI arguments are checked in order of their priority, which you can find in ServerPackCreator.Mode.
After the mode has been determined, you can acquire it with
getModeToRunIn().
If a specific language was passed using the -lang-argument, you can get it with
getLanguageToUse().
If ServerPackCreator was run with the --setup-argument specifying a
properties-file to load into ApplicationProperties, you can get said file via
propertiesFile(). Values are loaded from the specified file and
subsequently stored in the local serverpackcreator.properties-file inside
ServerPackCreators home-directory.
| Constructor and Description |
|---|
CommandlineParser(@NotNull java.lang.String[] args)
Create a new CommandlineParser from the passed commandline-arguments with which
ServerPackCreator was started.
|
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull java.util.Optional<java.lang.String> |
getLanguageToUse()
Get the locale in which ServerPackCreator should be run in, wrapped in an
Optional. |
protected @NotNull ServerPackCreator.Mode |
getModeToRunIn()
Get the mode in which ServerPackCreator should be run in.
|
@NotNull java.util.Optional<java.io.File> |
propertiesFile()
If ServerPackCreator was executed with the
--setup-argument as well as a
properties-file, then this method will return the specified properties file, wrapped in an
Optional, so you can check whether it is present or not. |
public CommandlineParser(@NotNull
@NotNull java.lang.String[] args)
getModeToRunIn() and
getLanguageToUse().getLanguageToUse() is wrapped in an
Optional to quickly determine whether a language was specified.args - Array of commandline-arguments with which ServerPackCreator was started.
Typically passed from ServerPackCreator.@NotNull protected @NotNull ServerPackCreator.Mode getModeToRunIn()
@NotNull protected @NotNull java.util.Optional<java.lang.String> getLanguageToUse()
Optional.Optional.@NotNull public @NotNull java.util.Optional<java.io.File> propertiesFile()
--setup-argument as well as a
properties-file, then this method will return the specified properties file, wrapped in an
Optional, so you can check whether it is present or not.