Package org.spongepowered.plugin.meta
Class PluginDependency
java.lang.Object
org.spongepowered.plugin.meta.PluginDependency
Represents a dependency on another plugin.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines when the dependency should be loaded in relation to the plugin. -
Constructor Summary
ConstructorDescriptionPluginDependency
(PluginDependency.LoadOrder loadOrder, String id, @Nullable String version, boolean optional) Constructs a newPluginDependency
with the given plugin ID and version range. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
id()
Returns the plugin ID of thisPluginDependency
.Returns the order to load the dependency in relation to the plugin.boolean
optional()
Returns whether the dependency is optional for the plugin to work correctly.toString()
version()
Returns the version range thisPluginDependency
should match.
-
Constructor Details
-
PluginDependency
public PluginDependency(PluginDependency.LoadOrder loadOrder, String id, @Nullable String version, boolean optional) Constructs a newPluginDependency
with the given plugin ID and version range.- Parameters:
loadOrder
- The order to load the dependency in relation to the pluginid
- The plugin ID of the dependencyversion
- The version range of the dependency ornull
optional
- Whether the dependency is optional- Throws:
IllegalArgumentException
- If the plugin ID is empty- See Also:
-
-
Method Details
-
loadOrder
Returns the order to load the dependency in relation to the plugin.- Returns:
- The load order
-
id
Returns the plugin ID of thisPluginDependency
.- Returns:
- The plugin ID
-
version
Returns the version range thisPluginDependency
should match.The version range should use the Maven version range syntax:
Maven version range syntax Range Meaning 1.0 Any 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
- Returns:
- The new optional dependency
-
asRequired
- Returns:
- The new required dependency
-
equals
-
hashCode
public int hashCode() -
toString
-