java.lang.Object
org.spongepowered.plugin.meta.PluginDependency

public final class PluginDependency extends Object
Represents a dependency on another plugin.
  • Constructor Details

  • Method Details

    • loadOrder

      public PluginDependency.LoadOrder loadOrder()
      Returns the order to load the dependency in relation to the plugin.
      Returns:
      The load order
    • id

      public String id()
      Returns the plugin ID of this PluginDependency.
      Returns:
      The plugin ID
    • version

      public @Nullable String version()
      Returns the version range this PluginDependency should match.

      The version range should use the Maven version range syntax:

      Maven version range syntax
      RangeMeaning
      1.0Any dependency version, 1.0 is recommended
      [1.0]x == 1.0
      [1.0,)x >= 1.0
      (1.0,)x > 1.0
      (,1.0]x <= 1.0
      (,1.0)x < 1.0
      (1.0,2.0)1.0 < x < 2.0
      [1.0,2.0]1.0 <= x <= 2.0
      Returns:
      The version range, or null if unspecified
      See Also:
    • optional

      public boolean optional()
      Returns whether the dependency is optional for the plugin to work correctly.
      Returns:
      True if the dependency is optional
    • asOptional

      public PluginDependency asOptional()
      Returns a new PluginDependency that has optional() set to true.
      Returns:
      The new optional dependency
    • asRequired

      public PluginDependency asRequired()
      Returns a new PluginDependency that has optional() set to false.
      Returns:
      The new required dependency
    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object