Class Options


  • public final class Options
    extends java.lang.Object
    Guice bean for accessing options from guice services. Bean usage is equivalent of option method for guicey bundle.

    Also used by installers to access options (see WithOptions).

    IMPORTANT: In contrast to OptionsInfo (which must be used for reporting only), this bean must be used for real option value usage. Only this bean will correctly return default value for option not used before (no set no gets).

    Since:
    11.08.2016
    See Also:
    for more info
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <V,​T extends java.lang.Enum & Option>
      V
      get​(T option)
      Read option value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

        public <V,​T extends java.lang.Enum & Option> V get​(T option)
        Read option value. Options could be set only in application root GuiceBundle.Builder.option(Enum, Object). If value wasn't set there then default value will be returned. Null may return only if it was default value and no new value were assigned.

        Option access is tracked as option usage (see OptionsInfo for options info).

        Type Parameters:
        V - option value type
        T - helper type to define option
        Parameters:
        option - option enum
        Returns:
        assigned option value or default value
        See Also:
        for more info about options, for options example