Constructor and Description |
---|
OptionImpl(String name) |
OptionImpl(String name,
Map<String,String> map) |
Modifier and Type | Method and Description |
---|---|
OptionImpl |
addAttribute(String name,
String value) |
OptionImpl |
addMap(Map<String,String> map) |
boolean |
containsAttribute(String name)
Checks whether this option has an attribute with the given name.
|
String |
getAttribute(String name)
Returns the attribute with the given name, if present.
|
int |
getAttributeAsInteger(String name) |
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 name, String value)
public boolean containsAttribute(String name)
Option
containsAttribute
in interface Option
name
- the name of the attribute to checktrue
if this option contains an attribute with the given name, false
otherwisepublic String getAttribute(String name)
Option
getAttribute
in interface Option
name
- the name of the attribute to getnull
otherwisepublic int getAttributeAsInteger(String name)
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–2021 aiticon GmbH. All rights reserved.