Class Options
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.option.Options
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 Summary
Constructors -
Method Summary
-
Constructor Details
-
Options
Create options.- Parameters:
optionsSupport- options support
-
-
Method Details
-
get
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
OptionsInfofor 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:
-