T - the upper bound of the options, which this registry handlespublic interface OptionRegistry<T extends Option<T>>
get(Class) method.
An option registry must only contain one option per marker interfaces (which have to be sub interfaces of T, the type
parameter of the option registry), so that the return value for get(Class) for each interface is uniquely
defined.
It is highly recommended, that instances of an option registry are immutable and serializable, since they will be
passed along with tensoric expressions. To 'change' options for a certain environment, the with(Option) can
be used, which has to return a new option registry, with all the same options, except the one which is marked by the
marker interface of the passed in option.
| Modifier and Type | Method and Description |
|---|---|
<T1 extends T> |
get(java.lang.Class<T1> optionType)
Has to return the option with the given marker interface
|
<T1 extends T> |
with(T1 newOption)
Has to return a new instance of an option registry, containing the same options, except the given one replacing
the previously contained option with the same marker interface.
|
<T1 extends T> T1 get(java.lang.Class<T1> optionType)
optionType - the class of the marker interface for which an instance has to be retrieved<T1 extends T> OptionRegistry<T> with(T1 newOption)
newOption - the new option to replace the previously contained with the same marker interface