Class ModuleDependency

java.lang.Object
eu.cloudnetservice.driver.module.ModuleDependency

public class ModuleDependency extends Object
Represents a dependency for the desired module. The module dependencies for a module are specified in the module configuration.

The specified dependency in the module configuration has to match in the following parts:

  • group
  • name
  • version
Since:
4.0
See Also:
  • Field Details

    • repo

      private final String repo
    • url

      private final String url
    • group

      private final String group
    • name

      private final String name
    • version

      private final String version
    • checksum

      private final String checksum
  • Constructor Details

    • ModuleDependency

      public ModuleDependency(@NonNull @NonNull String group, @NonNull @NonNull String name, @NonNull @NonNull String version)
      Creates a new module dependency instance. This dependency will require another module to be loaded before.
      Parameters:
      group - the group of the dependency.
      name - the name of the dependency.
      version - the version of the dependency.
      Throws:
      NullPointerException - if group, name or version is null.
    • ModuleDependency

      public ModuleDependency(@Nullable @Nullable String repo, @NonNull @NonNull String group, @NonNull @NonNull String name, @NonNull @NonNull String version)
      Creates a new module dependency instance. This dependency type will (when the repository is provided) require a dependency from a remote repository which needs to be downloaded. If the repository is not provided (in this case null) this dependency will require another module to be loaded before.
      Parameters:
      repo - the repository in which this dependency is located.
      group - the group of the dependency.
      name - the name of the dependency.
      version - the version of the dependency.
      Throws:
      NullPointerException - if group, name or version is null.
    • ModuleDependency

      Creates a new module dependency instance. This dependency type will (when the repository is provided) require a dependency from a remote repository which needs to be downloaded. If the direct download url is provided this dependency will be loaded from the direct url. Please note: if both the repository and url is provided, the direct download url will be ignored. If neither the repository nor the direct url is not provided (in this case null) this dependency will require another module to be loaded before.
      Parameters:
      repo - the repository in which this dependency is located.
      url - the direct download url of this dependency.
      group - the group of the dependency.
      name - the name of the dependency.
      version - the version of the dependency.
      checksum - the checksum of the dependency, null if this dependency represents a module.
      Throws:
      NullPointerException - if group, name or version is null.
  • Method Details

    • repo

      @Nullable public @Nullable String repo()
      Get the repository this dependency is located in.
      Returns:
      the repository this dependency is located in or null if not located in a repository.
    • url

      @Nullable public @Nullable String url()
      Get the direct download url of this dependency.
      Returns:
      the direct download url of this dependency or null if there is no direct download url.
    • group

      @NonNull public @NonNull String group()
      Get the group of this dependency.
      Returns:
      the group of this dependency.
    • name

      @NonNull public @NonNull String name()
      Get the name of this dependency.
      Returns:
      the name of this dependency.
    • version

      @NonNull public @NonNull String version()
      Get the version of this dependency.
      Returns:
      the version of this dependency.
    • checksum

      @Nullable public @Nullable String checksum()
      Get the checksum of this dependency, if known.
      Returns:
      the checksum of this dependency.
    • assertDefaultPropertiesSet

      public void assertDefaultPropertiesSet()
      Asserts that the required properties (group, name, version) are present.
      Throws:
      NullPointerException - if one of required properties is not set.
    • toString

      @NonNull public @NonNull String toString()
      Overrides:
      toString in class Object