Class Options
- java.lang.Object
-
- ru.vyarus.dropwizard.guice.module.context.option.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
-
-
Constructor Summary
Constructors Constructor Description Options(OptionsSupport optionsSupport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V,T extends java.lang.Enum & Option>
Vget(T option)
Read option value.
-
-
-
Constructor Detail
-
Options
public Options(OptionsSupport optionsSupport)
-
-
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 rootGuiceBundle.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 typeT
- 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
-
-