Class Modules

java.lang.Object
io.activej.inject.module.Modules

public class Modules extends Object
This class contains a set of utilities for working with modules.
  • Constructor Details

    • Modules

      public Modules()
  • Method Details

    • combine

      public static Module combine(Collection<Module> modules)
      Combines multiple modules into one.
    • combine

      public static Module combine(Module... modules)
      Combines multiple modules into one.
      See Also:
    • override

      public static Module override(List<Module> modules)
      Consecutively overrides each of the given modules with the next one after it and returns the accumulated result.
    • override

      public static Module override(Module... modules)
      Consecutively overrides each of the given modules with the next one after it and returns the accumulated result.
      See Also:
    • override

      public static Module override(Module into, Module replacements)
      This method creates a module that has bindings, transformers, generators and multibinders from first module replaced with bindings, transformers, generators and multibinders from the second module.
    • ignoreScopes

      public static Module ignoreScopes(Module from)
      Creates a module with all trie nodes merged into one and placed at root. Basically, any scopes are ignored. This is useful for some tests.
    • getImports

      public static Trie<Scope,Set<Key<?>>> getImports(Trie<Scope,Map<Key<?>,Set<Binding<?>>>> trie)
    • remap

      public static Module remap(Module module, Map<Key<?>,Key<?>> remapping)
    • remap

      public static Module remap(Module module, UnaryOperator<Key<?>> remapping)
    • remap

      public static Module remap(Module module, BiFunction<Scope[],Key<?>,Key<?>> exportsMapping, BiFunction<Scope[],Key<?>,Key<?>> importsMapping)
    • restrict

      public static Module restrict(Module module, Key<?>... exports)
    • restrict

      public static Module restrict(Module module, Set<Key<?>> exports)
    • restrict

      public static Module restrict(Module module, Predicate<Key<?>> exportsPredicate)
    • restrict

      public static Module restrict(Module module, BiPredicate<Scope[],Key<?>> exportsPredicate)