public class PackageId extends java.lang.Object implements java.lang.Comparable<PackageId>
PackageId
provides the basic metrics for identifying a package.
A package id consists of a group id, a name and a version.
the group is a relative path, eg: "company/project/subgroup", the name and the version
can be of any format.Modifier and Type | Field and Description |
---|---|
static PackageId[] |
EMPTY |
static java.lang.String |
ETC_PACKAGES
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
static java.lang.String |
ETC_PACKAGES_PREFIX
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
Constructor and Description |
---|
PackageId(java.lang.String path)
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
PackageId(java.lang.String path,
java.lang.String version)
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
PackageId(java.lang.String group,
java.lang.String name,
java.lang.String version)
Creates a new package id
|
PackageId(java.lang.String group,
java.lang.String name,
Version version)
Creates a new package id
|
PackageId(java.lang.String path,
Version version)
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PackageId o)
Compares this id with the given one.
|
boolean |
equals(java.lang.Object o) |
static PackageId[] |
fromString(java.lang.String... str)
Returns an array of package id from strings
|
static PackageId |
fromString(java.lang.String str)
Returns a package id from a id string.
|
java.lang.String |
getDownloadName()
Returns a download name in the form
name [ "-" version ] ".zip" |
java.lang.String |
getGroup()
Returns the group id of this package
|
java.lang.String |
getInstallationPath()
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
java.lang.String |
getName()
Returns the name of this package which is the last segment of the path.
|
Version |
getVersion()
Returns the version of this package or
null if n/a. |
java.lang.String |
getVersionString()
Returns the version of this package or and empty string if n/a.
|
int |
hashCode() |
boolean |
isFromPath()
Deprecated.
As of 3.1.42, the storage location is implementation details.
|
boolean |
isValid()
Checks if this package id is valid in respect to JCR names.
|
static boolean |
isValid(java.lang.String group,
java.lang.String name,
java.lang.String version)
Checks if the package id is valid in respect to JCR names.
|
java.lang.String |
toString()
Returns a string representation of this id
|
static java.lang.String |
toString(PackageId... packs)
Creates a comma separated list of id strings.
|
@Deprecated public static final java.lang.String ETC_PACKAGES
@Deprecated public static final java.lang.String ETC_PACKAGES_PREFIX
public static final PackageId[] EMPTY
@Deprecated public PackageId(java.lang.String path)
path
- path of the package@Deprecated public PackageId(java.lang.String path, java.lang.String version)
path
- path of the packageversion
- version of the package@Deprecated public PackageId(java.lang.String path, Version version)
path
- path of the packageversion
- version of the packagepublic PackageId(java.lang.String group, java.lang.String name, java.lang.String version)
group
- group idname
- nameversion
- versionpublic PackageId(java.lang.String group, java.lang.String name, Version version)
group
- group idname
- nameversion
- versionpublic static PackageId fromString(java.lang.String str)
null
is returned.str
- the stringpublic static PackageId[] fromString(java.lang.String... str)
str
- the stringspublic static java.lang.String toString(PackageId... packs)
packs
- the ids@Deprecated public boolean isFromPath()
true
if constructed from path.@Deprecated public java.lang.String getInstallationPath()
public java.lang.String getGroup()
public java.lang.String getName()
public java.lang.String getVersionString()
public java.lang.String getDownloadName()
name [ "-" version ] ".zip"
public Version getVersion()
null
if n/a.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(PackageId o)
compareTo
in interface java.lang.Comparable<PackageId>
public boolean isValid()
true
if the names are validpublic static boolean isValid(java.lang.String group, java.lang.String name, java.lang.String version)
group
- the package group namename
- the package nameversion
- the (optional) versiontrue
if the names are validCopyright © 2010 - 2020 Adobe. All Rights Reserved