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 Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsAttribute(String name)` Checks whether this option has an attribute with the given name.
    `String` | `getAttribute(String name)` Deprecated. use `getString(String)` instead
    `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>> 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.

- - ### 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

    - #### getAttribute

          @Deprecated
          String getAttribute(String name)

      Deprecated. use `getString(String)` instead
      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

    - #### 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

Copyright © 2011–2023 aiticon GmbH. All rights reserved.