Package org.appng.api
Interface Option
-
- All Known Implementing Classes:
OptionImpl
public interface Option
A single option which was created from aBeanOption
of aBean
.- Author:
- Matthias Herlitzius, Matthias Müller
- See Also:
Options
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
containsAttribute(String name)
Checks whether this option has an attribute with the given name.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.
-
-
-
Method Detail
-
getName
String getName()
Returns the name of this option.- Returns:
- the name of this option.
-
containsAttribute
boolean containsAttribute(String name)
Checks whether this option has an attribute with the given name.- Parameters:
name
- the name of the attribute to check- Returns:
true
if this option contains an attribute with the given name,false
otherwise
-
getAttributeNames
Set<String> getAttributeNames()
Returns the names of all attributes of this option- Returns:
- the names of all attributes
-
getString
String getString(String name)
Returns the attribute with the given name, if present.- Parameters:
name
- the name of the attribute to get- Returns:
- the attribute, if present,
null
otherwise
-
getInteger
Integer getInteger(String name)
Returns anInteger
parsed from the attribute with the given name.- 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
Boolean getBoolean(String name)
Returns aBoolean
parsed from the attribute with the given name.- 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
<E extends Enum<E>> E getEnum(String name, Class<E> type)
Returns theEnum
constant represented by the attribute with the given name.- Parameters:
name
- the name of the attribute to gettype
- the type of theEnum
- Returns:
- the enum constant, if the (upper-case) attribute value represents a valid enum of the given type
,
null
otherwise
-
-