de.caff.version

## Interface ModuleVersionService

- All Known Implementing Classes:
    ModuleVersion

      public interface ModuleVersionService

  Service interface used for retrieving module versions.

  It is expected that there is a class in each module which implements this service. There is no Java-intrinsic automatism how this implementations are created, and how they are announced in META-INF/services.

  Since:
    December 28, 2021
  Author:
    Rammi

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Indexable<ModuleVersionService>` | `collectServices()` Collect the module version services and cache them in an indexable.
    `static Indexable<ModuleVersionService>` | `collectServices(java.lang.String excludedModule)` Collect the module version services and cache them in an indexable.
    `java.lang.String` | `getModuleName()` Get the name of the module for which the version is given.
    `SemVer` | `getModuleVersion()` Get the current version of the module for which this service is responsible.
    `static java.util.Iterator<ModuleVersionService>` | `iterator()` Get an iterator over all module version services.
    `static java.util.Iterator<ModuleVersionService>` | `iterator(java.lang.String excludedModule)` Get an iterator over all module version services with one excluded.
    `static java.lang.String` | `makeDependsOutput(java.lang.String prefix, java.lang.String excludedModule)` Create a string for depending module versions. .

- - ### Method Detail

    - #### getModuleName

          @NotNull
          java.lang.String getModuleName()

      Get the name of the module for which the version is given.
      Returns:
        module name

    - #### getModuleVersion

          @NotNull
          SemVer getModuleVersion()

      Get the current version of the module for which this service is responsible.
      Returns:
        module version

    - #### iterator

          @NotNull
          static java.util.Iterator<ModuleVersionService> iterator()

      Get an iterator over all module version services. This reloads everything, so under normal circumstances (e.g. no dynamic class reloading) the result should be cached.
      Returns:
        iterator over all provided module version services

    - #### iterator

          @NotNull
          static java.util.Iterator<ModuleVersionService> iterator(@NotNull
                                                                            java.lang.String excludedModule)

      Get an iterator over all module version services with one excluded. This is useful to collect all modules on which the excluded one depends.
      Parameters:
        `excludedModule` - excluded module
      Returns:
        all modules but the excluded one

    - #### collectServices

          @NotNull
          static Indexable<ModuleVersionService> collectServices()

      Collect the module version services and cache them in an indexable. This takes a snapshot of the currently known services. If modules are added dynamically later on the versions of these modules will not be contained.
      Returns:
        currently available module version services

    - #### collectServices

          @NotNull
          static Indexable<ModuleVersionService> collectServices(@NotNull
                                                                          java.lang.String excludedModule)

      Collect the module version services and cache them in an indexable. This is useful to collect all modules on which the excluded one depends. This takes a snapshot of the currently known services. If modules are added dynamically later on the versions of these modules will not be contained.
      Parameters:
        `excludedModule` - excluded module
      Returns:
        currently available module version services

    - #### makeDependsOutput

          @NotNull
          static java.lang.String makeDependsOutput(@NotNull
                                                             java.lang.String prefix,
                                                             @NotNull
                                                             java.lang.String excludedModule)

      Create a string for depending module versions. .
      Parameters:
        `prefix` - prefix of the output, determines indentation of further lines
        `excludedModule` - module which is depending on others
      Returns:
        multi-line string