Class PluginDependency
- java.lang.Object
-
- com.velocitypowered.api.plugin.meta.PluginDependency
-
public final class PluginDependency extends java.lang.Object
Represents a dependency on another plugin.
-
-
Constructor Summary
Constructors Constructor Description PluginDependency(java.lang.String id, @Nullable java.lang.String version, boolean optional)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(@Nullable java.lang.Object o)
java.lang.String
getId()
Returns the plugin ID of thisPluginDependency
.java.util.Optional<java.lang.String>
getVersion()
Returns the version thisPluginDependency
should match.int
hashCode()
boolean
isOptional()
Returns whether the dependency is optional for the plugin to work correctly.java.lang.String
toString()
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Returns the plugin ID of thisPluginDependency
.- Returns:
- the plugin ID
-
getVersion
public java.util.Optional<java.lang.String> getVersion()
Returns the version thisPluginDependency
should match.- Returns:
- an
Optional
with the plugin version, may be empty
-
isOptional
public boolean isOptional()
Returns whether the dependency is optional for the plugin to work correctly.- Returns:
- true if dependency is optional
-
equals
public boolean equals(@Nullable java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-