Package org.appng.api
Interface Option
-
- All Known Implementing Classes:
OptionImpl
public interface OptionA single option which was created from aBeanOptionof aBean.- Author:
- Matthias Herlitzius, Matthias Müller
- See Also:
Options
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsAttribute(String name)Checks whether this option has an attribute with the given name.Set<String>getAttributeNames()Returns the names of all attributes of this optionBooleangetBoolean(String name)Returns aBooleanparsed from the attribute with the given name.<E extends Enum<E>>
EgetEnum(String name, Class<E> type)Returns theEnumconstant represented by the attribute with the given name.IntegergetInteger(String name)Returns anIntegerparsed from the attribute with the given name.StringgetName()Returns the name of this option.StringgetString(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:
trueif this option contains an attribute with the given name,falseotherwise
-
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,
nullotherwise
-
getInteger
Integer getInteger(String name)
Returns anIntegerparsed from the attribute with the given name.- Parameters:
name- the name of the attribute to get- Returns:
- the integer value, or
nullif no such attribute exists (or the value can not be parsed to an integer)
-
getBoolean
Boolean getBoolean(String name)
Returns aBooleanparsed from the attribute with the given name.- Parameters:
name- the name of the attribute to get- Returns:
Boolean.TRUEif the value of the attribute equals to (ignoring case)true,Boolean.FALSEotherwise
-
getEnum
<E extends Enum<E>> E getEnum(String name, Class<E> type)
Returns theEnumconstant 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
,
nullotherwise
-
-