Class ModuleInfo.BuilderBase<BUILDER extends ModuleInfo.BuilderBase<BUILDER>>

java.lang.Object
io.helidon.codegen.ModuleInfo.BuilderBase<BUILDER>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
All Implemented Interfaces:
Builder<BUILDER,ModuleInfo>, Supplier<ModuleInfo>
Direct Known Subclasses:
ModuleInfo.Builder
Enclosing interface:
ModuleInfo

public abstract static class ModuleInfo.BuilderBase<BUILDER extends ModuleInfo.BuilderBase<BUILDER>> extends Object implements Builder<BUILDER,ModuleInfo>
Fluent API builder base for ModuleInfo.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(ModuleInfo prototype)
      Update this builder from an existing prototype instance.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(ModuleInfo.BuilderBase<?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • name

      public BUILDER name(String name)
      Name of the module.
      Parameters:
      name - module name
      Returns:
      updated builder instance
      See Also:
    • isOpen

      public BUILDER isOpen(boolean isOpen)
      Whether this module is declared as open module.
      Parameters:
      isOpen - whether this module is open
      Returns:
      updated builder instance
      See Also:
    • requires

      public BUILDER requires(List<? extends ModuleInfoRequires> requires)
      Declared dependencies of the module.
      Parameters:
      requires - list of requires
      Returns:
      updated builder instance
      See Also:
    • addRequires

      public BUILDER addRequires(List<? extends ModuleInfoRequires> requires)
      Declared dependencies of the module.
      Parameters:
      requires - list of requires
      Returns:
      updated builder instance
      See Also:
    • addRequire

      public BUILDER addRequire(ModuleInfoRequires require)
      Declared dependencies of the module.
      Parameters:
      require - list of requires
      Returns:
      updated builder instance
      See Also:
    • exports

      public BUILDER exports(Map<? extends String,List<String>> exports)
      Exports of the module.
      Parameters:
      exports - list of exported packages
      Returns:
      updated builder instance
      See Also:
    • addExports

      public BUILDER addExports(Map<? extends String,List<String>> exports)
      Exports of the module.
      Parameters:
      exports - list of exported packages
      Returns:
      updated builder instance
      See Also:
    • putExports

      public BUILDER putExports(String packageName, List<String> moduleNames)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      packageName - key to add or replace
      moduleNames - new value for the key
      Returns:
      updated builder instance
      See Also:
    • addExport

      public BUILDER addExport(String export, String to)
      Exports of the module.
      Parameters:
      export - package to export
      to - exported to a module
      Returns:
      updated builder instance
      See Also:
    • uses

      public BUILDER uses(List<? extends TypeName> uses)
      Used service loader providers.
      Parameters:
      uses - list of used provider interfaces
      Returns:
      updated builder instance
      See Also:
    • addUses

      public BUILDER addUses(List<? extends TypeName> uses)
      Used service loader providers.
      Parameters:
      uses - list of used provider interfaces
      Returns:
      updated builder instance
      See Also:
    • addUse

      public BUILDER addUse(TypeName use)
      Used service loader providers.
      Parameters:
      use - list of used provider interfaces
      Returns:
      updated builder instance
      See Also:
    • addUse

      public BUILDER addUse(Consumer<TypeName.Builder> consumer)
      Used service loader providers.
      Parameters:
      consumer - list of used provider interfaces
      Returns:
      updated builder instance
      See Also:
    • provides

      public BUILDER provides(Map<? extends TypeName,List<TypeName>> provides)
      This method replaces all values with the new ones.
      Parameters:
      provides - map of interface to implementations
      Returns:
      updated builder instance
      See Also:
    • addProvides

      public BUILDER addProvides(Map<? extends TypeName,List<TypeName>> provides)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      provides - map of interface to implementations
      Returns:
      updated builder instance
      See Also:
    • addProvide

      public BUILDER addProvide(TypeName key, TypeName provide)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      provide - additional value for the key
      Returns:
      updated builder instance
      See Also:
    • addProvides

      public BUILDER addProvides(TypeName key, List<TypeName> provides)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      provides - additional values for the key
      Returns:
      updated builder instance
      See Also:
    • putProvide

      public BUILDER putProvide(TypeName key, List<TypeName> provide)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      provide - new value for the key
      Returns:
      updated builder instance
      See Also:
    • opens

      public BUILDER opens(Map<? extends String,List<String>> opens)
      This method replaces all values with the new ones.
      Parameters:
      opens - map of package to modules
      Returns:
      updated builder instance
      See Also:
    • addOpens

      public BUILDER addOpens(Map<? extends String,List<String>> opens)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      opens - map of package to modules
      Returns:
      updated builder instance
      See Also:
    • addOpen

      public BUILDER addOpen(String key, String open)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      open - additional value for the key
      Returns:
      updated builder instance
      See Also:
    • addOpens

      public BUILDER addOpens(String key, List<String> opens)
      This method adds a new value to the map value, or creates a new value.
      Parameters:
      key - key to add to
      opens - additional values for the key
      Returns:
      updated builder instance
      See Also:
    • putOpen

      public BUILDER putOpen(String key, List<String> open)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      open - new value for the key
      Returns:
      updated builder instance
      See Also:
    • name

      public Optional<String> name()
      Name of the module.
      Returns:
      the name
    • isOpen

      public boolean isOpen()
      Whether this module is declared as open module.
      Returns:
      the is open
    • requires

      public List<ModuleInfoRequires> requires()
      Declared dependencies of the module.
      Returns:
      the requires
    • exports

      public Map<String,List<String>> exports()
      Exports of the module.
      Returns:
      the exports
    • uses

      public List<TypeName> uses()
      Used service loader providers.
      Returns:
      the uses
    • provides

      public Map<TypeName,List<TypeName>> provides()
      Map of provider interfaces to provider implementations provided by this module.
      Returns:
      the provides
    • opens

      public Map<String,List<String>> opens()
      Map of opened packages to modules (if any).
      Returns:
      the opens
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.