java.lang.Object
ru.vyarus.dropwizard.guice.module.context.option.internal.OptionsSupport<T>
- Type Parameters:
T- helper type to define option
Options support logic. Holds configured options and controls option correctness.
Because enums are used for option definition, option value checks couldn't be performed at compile time. Check is performed manually during value assignment.
Option may have null as default value, but null can't be assigned manually.
- Since:
- 09.08.2016
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OptionsSupport
public OptionsSupport()
-
-
Method Details
-
set
- Parameters:
option- option enumvalue- option value (not null)- Throws:
NullPointerException- for null valueIllegalArgumentException- for value incompatible with option type
-
get
- Type Parameters:
P- option value- Parameters:
option- option enum- Returns:
- defined or default option value
-
getHolder
- Parameters:
option- option- Returns:
- option holder object
- Throws:
IllegalArgumentException- if option is not registered (not used)
-
containsOption
- Parameters:
option- option- Returns:
- true if option registered (was used or set), false otherwise
-
getOptions
- Returns:
- set with all used options
-