Modifier and Type | Field and Description |
---|---|
protected Map<String,Option> |
optionsMap |
Constructor and Description |
---|
OptionsImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addOption(Option option) |
Boolean |
getBoolean(String name,
String attribute)
|
<E extends Enum<E>> |
getEnum(String name,
String attribute,
Class<E> type)
|
Integer |
getInteger(String name,
String attribute)
|
Option |
getOption(String name)
Returns the
Option with the given name, if present. |
Set<String> |
getOptionNames()
Returns the names of all available
Option s |
String |
getOptionValue(String optionName,
String attributeName)
Returns the attribute with the given name for the
Option with the given name. |
String |
getString(String name,
String attribute)
Returns the attribute with the given name for the
Option with the given name. |
boolean |
hasOption(String name)
Checks whether there is an
Option with the given name. |
String |
toString() |
public void addOption(Option option)
public Option getOption(String name)
Options
Option
with the given name, if present.public boolean hasOption(String name)
Options
Option
with the given name.public Set<String> getOptionNames()
Options
Option
sgetOptionNames
in interface Options
Option
spublic String getOptionValue(String optionName, String attributeName)
Options
Option
with the given name.getOptionValue
in interface Options
optionName
- the name of the Option
to get the attribute fromattributeName
- the name of the attribute of the Option
null
if either the Option
or the attribute does not
existpublic String getString(String name, String attribute)
Options
Option
with the given name.public Integer getInteger(String name, String attribute)
Options
Integer
parsed from the attribute with the given name for the Option
with the given
name.getInteger
in interface Options
name
- the name of the Option
to get the attribute fromattribute
- the name of the attribute of the Option
null
if either the Option
or the attribute does not exist or the or
the value can not be parsed to an integerpublic Boolean getBoolean(String name, String attribute)
Options
getBoolean
in interface Options
name
- the name of the Option
to get the attribute fromattribute
- the name of the attribute of the Option
Boolean.TRUE
if the value of the attribute equals to (ignoring case) true
,
Boolean.FALSE
otherwise (also if no such Option
exists)public <E extends Enum<E>> E getEnum(String name, String attribute, Class<E> type)
Options
Enum
constant of the given type represented by the attribute with the given name for the
Option
with the given name.getEnum
in interface Options
name
- the name of the Option
to get the attribute fromattribute
- the name of the attribute of the Option
null
otherwise (also if no such Option
exists)Copyright © 2011–2021 aiticon GmbH. All rights reserved.