Class Modules
org.elasticsearch.common.inject.util.Modules
public final class Modules
extends
Static utility methods for creating and working with instances of
Module
.- Since:
- 2.0
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Module
<? extends Module> modules)
Returns a new module that installs all ofmodules
.static Module
Returns a new module that installs all ofmodules
.<? extends Module> modules)
Returns a builder that creates a module that overlays override modules over the given modules.Returns a builder that creates a module that overlays override modules over the given modules.Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
EMPTY_MODULE
-
-
Method Details
-
override
Returns a builder that creates a module that overlays override modules over the given modules. If a key is bound in both sets of modules, only the binding from the override modules is kept. 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.
- Parameters:
modules
- the modules whose bindings are open to be overridden
-
override
public static <? extends Module> modules)Returns a builder that creates a module that overlays override modules over the given modules. If a key is bound in both sets of modules, only the binding from the override modules is kept. 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.
- Parameters:
modules
- the modules whose bindings are open to be overridden
-
combine
Returns a new module that installs all ofmodules
. -
combine
public static <? extends Module> modules)Returns a new module that installs all ofmodules
.
-