Package org.appng.api

Interface Option

  • All Known Implementing Classes:
    OptionImpl

    public interface Option
    A single option which was created from a BeanOption of a Bean .
    Author:
    Matthias Herlitzius, Matthias Müller
    See Also:
    Options
    • 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 an Integer 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 a Boolean 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 the Enum constant represented by the attribute with the given name.
        Parameters:
        name - the name of the attribute to get
        type - the type of the Enum
        Returns:
        the enum constant, if the (upper-case) attribute value represents a valid enum of the given type ,null otherwise