Class Dependency
java.lang.Object
org.apache.jackrabbit.vault.packaging.Dependency
Implements a package dependency reference.
The string representation is
<group>:<name>[:<versionrange>]- Since:
- 2.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDependency(@NotNull String groupId, @NotNull String name, @Nullable VersionRange range) Creates a new dependency reference.Dependency(@NotNull PackageId id) Creates a new dependency to the specified package id -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull Dependency[]fromString(@NotNull String... str) Returns dependencies from the given strings.static @Nullable DependencyfromString(@Nullable String str) Returns a dependency from a string. if the given id is null or an empty string,nullis returned.@NotNull StringgetGroup()Returns the group of the dependency@NotNull StringgetName()Returns the name of the dependency@NotNull StringgetPath()Deprecated.As of 3.1.42, the storage location is implementation details.@NotNull VersionRangegetRange()Returns the version rangeinthashCode()booleanChecks if the given package id matches this dependency specification.static @NotNull Dependency[]Parses a string serialization of dependencies generated bytoString(Dependency...).@NotNull StringtoString()static @NotNull StringtoString(@NotNull Dependency... deps) Returns a string representation from given dependencies.
-
Field Details
-
EMPTY
An empty dependency array
-
-
Constructor Details
-
Dependency
public Dependency(@NotNull @NotNull String groupId, @NotNull @NotNull String name, @Nullable @Nullable VersionRange range) Creates a new dependency reference.- Parameters:
groupId- group idname- namerange- version range
-
Dependency
Creates a new dependency to the specified package id- Parameters:
id- package id.
-
-
Method Details
-
getGroup
Returns the group of the dependency- Returns:
- the group id
- Since:
- 2.4
-
getName
Returns the name of the dependency- Returns:
- the name
-
getRange
Returns the version range- Returns:
- the version range
-
getPath
Deprecated.As of 3.1.42, the storage location is implementation details.Returns the installation path of this dependency- Returns:
- the installation path;
-
matches
Checks if the given package id matches this dependency specification.- Parameters:
id- the package id- Returns:
trueif matches
-
fromString
Returns a dependency from a string. if the given id is null or an empty string,nullis returned.- Parameters:
str- the string- Returns:
- the dependency
-
parse
Parses a string serialization of dependencies generated bytoString(Dependency...).- Parameters:
str- serialized string- Returns:
- array of dependency references
-
fromString
Returns dependencies from the given strings.- Parameters:
str- the strings- Returns:
- the dependencies
-
toString
Returns a string representation from given dependencies. Dependencies are separated by ','.- Parameters:
deps- the dependencies- Returns:
- the strings
-
toString
-
equals
-
hashCode
public int hashCode()
-