Class Identifier
-
- All Implemented Interfaces:
-
kotlin.Comparable
public final class Identifier implements Comparable<Identifier>
A unique identifier for a software package.
-
-
Constructor Summary
Constructors Constructor Description Identifier(String identifier)Create an Identifier from a string with the format "type:namespace:name:version". Identifier(String type, String namespace, String name, String version)
-
Method Summary
Modifier and Type Method Description final StringgetType()The type of package. final StringgetNamespace()The namespace of the package, for example the group for "Maven" or the scope for "NPM". final StringgetName()The name of the package. final StringgetVersion()The version of the package. IntegercompareTo(Identifier other)final BooleanisFromOrg(String names)Return whether this Identifier is likely to belong any of the organizations mentioned in names by looking at the namespace. final StringtoCoordinates()Create Maven-like coordinates based on the properties of the Identifier. final StringtoPath(String separator, String emptyValue)Create a file system path based on the properties of the Identifier. -
-
Method Detail
-
getType
final String getType()
The type of package. When used in the context of a Project, the type is the name of the package manager that manages the project (e.g. "Gradle" for a Gradle project). When used in the context of a Package, the type is the name of the package type or protocol (e.g. "Maven" for a file from a Maven repository).
-
getNamespace
final String getNamespace()
The namespace of the package, for example the group for "Maven" or the scope for "NPM".
-
getVersion
final String getVersion()
The version of the package.
-
compareTo
Integer compareTo(Identifier other)
-
isFromOrg
final Boolean isFromOrg(String names)
Return whether this Identifier is likely to belong any of the organizations mentioned in names by looking at the namespace.
-
toCoordinates
final String toCoordinates()
Create Maven-like coordinates based on the properties of the Identifier.
-
toPath
final String toPath(String separator, String emptyValue)
Create a file system path based on the properties of the Identifier. All properties are encoded using encodeOr with emptyValue as parameter.
-
-
-
-