java.lang.Object
ru.vyarus.dropwizard.guice.module.context.option.Options

public final class Options extends 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:
  • Constructor Details

    • Options

      public Options(OptionsSupport optionsSupport)
      Create options.
      Parameters:
      optionsSupport - options support
  • Method Details

    • get

      public <V, T extends 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: