Interface OptionContainer

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default boolean getBoolean​(java.lang.String id)
      Gets the value of a BooleanOption.
      default java.io.File getFile​(java.lang.String id)
      Gets the file value of a FileOption.
      default int getInteger​(java.lang.String id)
      Gets the value of an IntegerOption.
      default int getIntegerMinimum​(java.lang.String id)
      Gets the minimum value of an IntegerOption.
      default java.util.List<FreeColModFile> getModList​(java.lang.String id)
      Gets the mod list from a ModListOption.
      <T extends Option>
      T
      getOption​(java.lang.String id, java.lang.Class<T> returnClass)
      Get an option in this group (or descendents) by object identifier.
      default OptionGroup getOptionGroup​(java.lang.String id)
      Gets the value of an OptionGroup.
      default int getPercentage​(java.lang.String id)
      Gets the percentage value of a PercentageOption.
      default double getPercentageMultiplier​(java.lang.String id)
      Gets the percentage value of a PercentageOption normalized to double.
      default int getRange​(java.lang.String id)
      Gets the value of a RangeOption.
      default int getSelection​(java.lang.String id)
      Gets the value of a SelectOption.
      default java.lang.String getSelectionName​(java.lang.String id)
      Gets the name associated with the current value of a SelectOption.
      default java.lang.String getString​(java.lang.String id)
      Gets the string value of an option.
      default java.lang.String getText​(java.lang.String id)
      Gets the value of a TextOption.
      default java.util.List<AbstractUnit> getUnitList​(java.lang.String id)
      Gets the unit list from a UnitListOption.
      <T extends Option>
      boolean
      hasOption​(java.lang.String id, java.lang.Class<T> returnClass)
      Is an option present in the container.
      default void setBoolean​(java.lang.String id, boolean value)
      Sets the value of a BooleanOption.
      default void setFile​(java.lang.String id, java.io.File value)
      Sets the value of a FileOption.
      default void setInteger​(java.lang.String id, int value)
      Sets the value of an IntegerOption.
      default void setIntegerMinimum​(java.lang.String id, java.lang.Integer value)
      Sets the minimum value of an IntegerOption.
      default void setString​(java.lang.String id, java.lang.String value)
      Sets the string value of an option.
      default void setText​(java.lang.String id, java.lang.String value)
      Sets the value of a TextOption.
    • Method Detail

      • hasOption

        <T extends Option> boolean hasOption​(java.lang.String id,
                                             java.lang.Class<T> returnClass)
        Is an option present in the container.
        Type Parameters:
        T - The actual return type.
        Parameters:
        id - The object identifier.
        returnClass - The expected option class.
        Returns:
        True if the option is present.
      • getOption

        <T extends Option> T getOption​(java.lang.String id,
                                       java.lang.Class<T> returnClass)
        Get an option in this group (or descendents) by object identifier.
        Type Parameters:
        T - The actual return type.
        Parameters:
        id - The object identifier.
        returnClass - The expected option class.
        Returns:
        The option, or a run time exception if the option does not exist or is of the wrong class.
      • getBoolean

        default boolean getBoolean​(java.lang.String id)
        Gets the value of a BooleanOption.
        Parameters:
        id - The object identifier.
        Returns:
        The boolean value.
      • setBoolean

        default void setBoolean​(java.lang.String id,
                                boolean value)
        Sets the value of a BooleanOption.
        Parameters:
        id - The object identifier.
        value - The new boolean value of the option.
      • getFile

        default java.io.File getFile​(java.lang.String id)
        Gets the file value of a FileOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • setFile

        default void setFile​(java.lang.String id,
                             java.io.File value)
        Sets the value of a FileOption.
        Parameters:
        id - The object identifier.
        value - The new value.
      • getInteger

        default int getInteger​(java.lang.String id)
        Gets the value of an IntegerOption.
        Parameters:
        id - The object identifier.
        Returns:
        The integer value.
      • setInteger

        default void setInteger​(java.lang.String id,
                                int value)
        Sets the value of an IntegerOption.
        Parameters:
        id - The object identifier.
        value - The new integer value of the option.
      • getIntegerMinimum

        default int getIntegerMinimum​(java.lang.String id)
        Gets the minimum value of an IntegerOption.
        Parameters:
        id - The object identifier.
        Returns:
        value The minimum value.
      • setIntegerMinimum

        default void setIntegerMinimum​(java.lang.String id,
                                       java.lang.Integer value)
        Sets the minimum value of an IntegerOption.
        Parameters:
        id - The object identifier.
        value - The new minimum value.
      • getModList

        default java.util.List<FreeColModFile> getModList​(java.lang.String id)
        Gets the mod list from a ModListOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • getOptionGroup

        default OptionGroup getOptionGroup​(java.lang.String id)
        Gets the value of an OptionGroup.
        Parameters:
        id - The object identifier.
        Returns:
        The OptionGroup value.
      • getPercentage

        default int getPercentage​(java.lang.String id)
        Gets the percentage value of a PercentageOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • getPercentageMultiplier

        default double getPercentageMultiplier​(java.lang.String id)
        Gets the percentage value of a PercentageOption normalized to double.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • getRange

        default int getRange​(java.lang.String id)
        Gets the value of a RangeOption.
        Parameters:
        id - The object identifier.
        Returns:
        The range value.
      • getString

        default java.lang.String getString​(java.lang.String id)
        Gets the string value of an option.
        Parameters:
        id - The object identifier.
        Returns:
        The string value.
      • setString

        default void setString​(java.lang.String id,
                               java.lang.String value)
        Sets the string value of an option.
        Parameters:
        id - The object identifier.
        value - The new string value.
      • getSelection

        default int getSelection​(java.lang.String id)
        Gets the value of a SelectOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • getSelectionName

        default java.lang.String getSelectionName​(java.lang.String id)
        Gets the name associated with the current value of a SelectOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.
      • getText

        default java.lang.String getText​(java.lang.String id)
        Gets the value of a TextOption.
        Parameters:
        id - The object identifier.
        Returns:
        The string value.
      • setText

        default void setText​(java.lang.String id,
                             java.lang.String value)
        Sets the value of a TextOption.
        Parameters:
        id - The object identifier.
        value - The new string value.
      • getUnitList

        default java.util.List<AbstractUnit> getUnitList​(java.lang.String id)
        Gets the unit list from a UnitListOption.
        Parameters:
        id - The object identifier.
        Returns:
        The value.