| Modifier and Type | Class and Description |
|---|---|
static interface |
Modules
See the EDSL example at
override().
|
| Modifier and Type | Field and Description |
|---|---|
static Module |
EMPTY_MODULE
|
| Modifier and Type | Method and Description |
|---|---|
static Module |
combine(Iterable
Returns a new module that installs all of
modules.
|
static Module |
combine(Module
Returns a new module that installs all of
modules.
|
static Modules |
override(Iterable
Returns a builder that creates a module that overlays override modules over the given modules.
|
static Modules |
override(Module
Returns a builder that creates a module that overlays override modules over the given modules.
|
public static final ModuleEMPTY_MODULE
public static Modules.OverriddenModuleBuilder override(Module ... modules)
PrivateModule is supplied or all elements are from a single
PrivateBinder, then this will overwrite the private bindings. Otherwise, private bindings will not be overwritten unless they are exposed. This can be used to replace the bindings of a production module with test bindings:
Module functionalTestModule
= Modules.override(new ProductionModule()).with(new TestModule());
Prefer to write smaller modules that can be reused and tested without overrides.
modules - the modules whose bindings are open to be overridden
public static Modules.OverriddenModuleBuilder override(Iterable <? extends Module > modules)
PrivateModule is supplied or all elements are from a single
PrivateBinder, then this will overwrite the private bindings. Otherwise, private bindings will not be overwritten unless they are exposed. This can be used to replace the bindings of a production module with test bindings:
Module functionalTestModule
= Modules.override(getProductionModules()).with(getTestModules());
Prefer to write smaller modules that can be reused and tested without overrides.
modules - the modules whose bindings are open to be overridden
public static Modulecombine(Module ... modules)
modules.