public final class OptionsInfo
extends java.lang.Object
GuiceBundle) or read (by guicey, bundles or guice services).
Instance bound to guice context and available for injection. Also may be accessed through
GuiceyConfigurationInfo.getOptions().
NOTE: service just provides info of already used options (consultation only service - for reporting).
If option wasn't used then default value will not be returned (error will be thrown). Option value read will not
mark option as used. Do not use it for reading option value (for actual option usage): use Options instead.
Most methods accept simple Enum instead of Enum & Option to simplify generic usage: if not allowed enum
value will be used methods will throw exceptions. knowsOption(Enum) method may be used to
safely check enum value before calling actual data methods.
for options details| Constructor and Description |
|---|
OptionsInfo(OptionsSupport support) |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.Class<java.lang.Enum>> |
getOptionGroups()
In contrast to
getOptions() returns only enum types of used options. |
<T extends java.lang.Enum & Option> |
getOptions()
NOTE: as option could be accessed at any time by guice service, so more options could appear over time.
|
<V> V |
getValue(java.lang.Enum option) |
boolean |
isSet(java.lang.Enum option)
All options are set in application (before application start) and will not change after.
|
boolean |
isUsed(java.lang.Enum option)
Option usage tracked when option read by either
bundle or
from guice service.
|
boolean |
knowsOption(java.lang.Enum option)
Use this method to check if option is available for reporting (option details methods will fail with
exception if not known option will be provided).
|
public OptionsInfo(OptionsSupport support)
public <T extends java.lang.Enum & Option> java.util.Set<T> getOptions()
T - helper type to define optionfor option groupspublic java.util.List<java.lang.Class<java.lang.Enum>> getOptionGroups()
getOptions() returns only enum types of used options.
For example, GuiceyOptions is enum type for core guicey options.public <V> V getValue(java.lang.Enum option)
V - value typeoption - option enumjava.lang.IllegalArgumentException - if option was not usedpublic boolean isUsed(java.lang.Enum option)
option - option enumjava.lang.IllegalArgumentException - if option was not usedpublic boolean isSet(java.lang.Enum option)
option - option enumjava.lang.IllegalArgumentException - if option was not usedpublic boolean knowsOption(java.lang.Enum option)
option - option enum