Class Dependency
- java.lang.Object
-
- org.apache.jackrabbit.vault.packaging.Dependency
-
public class Dependency extends java.lang.ObjectImplements a package dependency reference.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description static Dependency[]EMPTYAn empty dependency array
-
Constructor Summary
Constructors Constructor Description Dependency(java.lang.String groupId, java.lang.String name, VersionRange range)Creates a new dependency reference.Dependency(PackageId id)Creates a new dependency to the specified package id
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static DependencyfromString(java.lang.String str)Returns a dependency from a string.static Dependency[]fromString(java.lang.String... str)Returns dependencies from the given strings.java.lang.StringgetGroup()Returns the group of the dependencyjava.lang.StringgetName()Returns the name of the dependencyjava.lang.StringgetPath()Deprecated.As of 3.1.42, the storage location is implementation details.VersionRangegetRange()Returns the version rangeinthashCode()booleanmatches(PackageId id)Checks if the given package id matches this dependency specification.static Dependency[]parse(java.lang.String str)Parses a string serialization of dependency references generated bytoString(Dependency...))}java.lang.StringtoString()static java.lang.StringtoString(Dependency... deps)Returns a string representation from given dependencies.
-
-
-
Field Detail
-
EMPTY
public static final Dependency[] EMPTY
An empty dependency array
-
-
Constructor Detail
-
Dependency
public Dependency(@Nonnull java.lang.String groupId, @Nonnull java.lang.String name, @Nullable VersionRange range)Creates a new dependency reference.- Parameters:
groupId- group idname- namerange- version range
-
Dependency
public Dependency(@Nonnull PackageId id)Creates a new dependency to the specified package id- Parameters:
id- package id.
-
-
Method Detail
-
getGroup
@Nonnull public java.lang.String getGroup()
Returns the group of the dependency- Returns:
- the group id
- Since:
- 2.4
-
getName
@Nonnull public java.lang.String getName()
Returns the name of the dependency- Returns:
- the name
-
getRange
@Nonnull public VersionRange getRange()
Returns the version range- Returns:
- the version range
-
getPath
@Deprecated @Nonnull public java.lang.String 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
public boolean matches(@Nonnull PackageId id)Checks if the given package id matches this dependency specification.- Parameters:
id- the package id- Returns:
trueif matches
-
fromString
@Nullable public static Dependency fromString(@Nullable java.lang.String str)
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
@Nonnull public static Dependency[] parse(@Nonnull java.lang.String str)
Parses a string serialization of dependency references generated bytoString(Dependency...))}- Parameters:
str- serialized string- Returns:
- array of dependency references
-
fromString
@Nonnull public static Dependency[] fromString(@Nonnull java.lang.String... str)
Returns dependencies from the given strings.- Parameters:
str- the strings- Returns:
- the dependencies
-
toString
@Nonnull public static java.lang.String toString(@Nonnull Dependency... deps)Returns a string representation from given dependencies.- Parameters:
deps- the dependencies- Returns:
- the strings
-
toString
@Nonnull public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-