Package org.appng.api.support
Class OptionImpl
- java.lang.Object
-
- org.appng.api.support.OptionImpl
-
-
Constructor Summary
Constructors Constructor Description OptionImpl(String name)
OptionImpl(String name, Map<String,String> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
int
getAttributeAsInteger(String name)
Map<String,String>
getAttributeMap()
Set<String>
getAttributeNames()
Returns the names of all attributes of this optionBoolean
getBoolean(String name)
Returns aBoolean
parsed from the attribute with the given name.<E extends Enum<E>>
EgetEnum(String name, Class<E> type)
Returns theEnum
constant represented by the attribute with the given name.Integer
getInteger(String name)
Returns anInteger
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()
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Option
Returns the name of this option.
-
addMap
public OptionImpl addMap(Map<String,String> map)
-
addAttribute
public OptionImpl addAttribute(String name, String value)
-
containsAttribute
public boolean containsAttribute(String name)
Description copied from interface:Option
Checks whether this option has an attribute with the given name.- Specified by:
containsAttribute
in interfaceOption
- Parameters:
name
- the name of the attribute to check- Returns:
true
if this option contains an attribute with the given name,false
otherwise
-
getAttributeAsInteger
public int getAttributeAsInteger(String name)
-
getAttributeNames
public Set<String> getAttributeNames()
Description copied from interface:Option
Returns the names of all attributes of this option- Specified by:
getAttributeNames
in interfaceOption
- Returns:
- the names of all attributes
-
getString
public String getString(String name)
Description copied from interface:Option
Returns the attribute with the given name, if present.
-
getInteger
public Integer getInteger(String name)
Description copied from interface:Option
Returns anInteger
parsed from the attribute with the given name.- Specified by:
getInteger
in interfaceOption
- Parameters:
name
- the name of the attribute to get- Returns:
- the integer value, or
null
if no such attribute exists (or the value can not be parsed to an integer)
-
getBoolean
public Boolean getBoolean(String name)
Description copied from interface:Option
Returns aBoolean
parsed from the attribute with the given name.- Specified by:
getBoolean
in interfaceOption
- Parameters:
name
- the name of the attribute to get- Returns:
Boolean.TRUE
if the value of the attribute equals to (ignoring case)true
,Boolean.FALSE
otherwise
-
getEnum
public <E extends Enum<E>> E getEnum(String name, Class<E> type)
Description copied from interface:Option
Returns theEnum
constant represented by the attribute with the given name.
-
-