Package org.spongepowered.plugin.meta
Class PluginDependency
java.lang.Object
org.spongepowered.plugin.meta.PluginDependency
Represents a dependency on another plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines when the dependency should be loaded in relation to the plugin. -
Constructor Summary
ConstructorsConstructorDescriptionPluginDependency(PluginDependency.LoadOrder loadOrder, String id, @Nullable String version, boolean optional) Constructs a newPluginDependencywith the given plugin ID and version range. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()id()Returns the plugin ID of thisPluginDependency.Returns the order to load the dependency in relation to the plugin.booleanoptional()Returns whether the dependency is optional for the plugin to work correctly.toString()version()Returns the version range thisPluginDependencyshould match.
-
Constructor Details
-
PluginDependency
public PluginDependency(PluginDependency.LoadOrder loadOrder, String id, @Nullable String version, boolean optional) Constructs a newPluginDependencywith 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 ornulloptional- 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 thisPluginDependencyshould 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
nullif 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
-