Constructor and Description |
---|
OptionImpl(String name) |
OptionImpl(String name,
Map<String,String> map) |
Modifier and Type | Method and Description |
---|---|
OptionImpl |
addAttribute(String key,
String value) |
OptionImpl |
addMap(Map<String,String> map) |
boolean |
containsAttribute(String key)
Checks whether this option has an attribute with the given name.
|
String |
getAttribute(String key)
Returns the attribute with the given name, if present.
|
int |
getAttributeAsInteger(String key) |
Map<String,String> |
getAttributeMap() |
Set<String> |
getAttributeNames()
Returns the names of all attributes of this option
|
Boolean |
getBoolean(String name)
Returns a
Boolean parsed from the attribute with the given name. |
<E extends Enum<E>> |
getEnum(String name,
Class<E> type)
Returns the
Enum constant represented by the attribute with the given name. |
Integer |
getInteger(String name)
Returns an
Integer parsed from the attribute with the given name. |
String |
getName()
Returns the name of this option.
|
String |
getString(String name)
Returns the attribute with the given name, if present.
|
String |
toString() |
public OptionImpl(String name)
public String getName()
Option
public OptionImpl addMap(Map<String,String> map)
public OptionImpl addAttribute(String key, String value)
public boolean containsAttribute(String key)
Option
containsAttribute
in interface Option
key
- the name of the attribute to checktrue
if this option contains an attribute with the given name, false
otherwisepublic String getAttribute(String key)
Option
getAttribute
in interface Option
key
- the name of the attribute to getnull
otherwisepublic int getAttributeAsInteger(String key)
public Set<String> getAttributeNames()
Option
getAttributeNames
in interface Option
public String getString(String name)
Option
public Integer getInteger(String name)
Option
Integer
parsed from the attribute with the given name.getInteger
in interface Option
name
- the name of the attribute to getnull
if no such attribute exists (or the value can not be parsed to an
integer)public Boolean getBoolean(String name)
Option
Boolean
parsed from the attribute with the given name.getBoolean
in interface Option
name
- the name of the attribute to getBoolean.TRUE
if the value of the attribute equals to (ignoring case) true
,
Boolean.FALSE
otherwisepublic <E extends Enum<E>> E getEnum(String name, Class<E> type)
Option
Enum
constant represented by the attribute with the given name.Copyright © 2011–2017 aiticon GmbH. All rights reserved.