Package io.quarkus.sbom
Class Purl
java.lang.Object
io.quarkus.sbom.Purl
A lightweight, immutable Package URL (PURL) representation following the
purl-spec.
Format: pkg:<type>/<namespace>/<name>@<version>?<qualifiers>#<subpath>
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Purl.Builderbuilder()booleanstatic PurlCreates a generic PURL with no namespace or qualifiers.getName()getType()inthashCode()static PurlCreates a Maven PURL withtype=jarqualifier.static PurlCreates a Maven PURL with explicit type and classifier qualifiers.static PurlCreates an npm PURL.static PurlCreates a PURL with the specified type.static PurlParses a canonical PURL string.toString()Returns the canonical PURL string representation.
-
Field Details
-
TYPE_MAVEN
- See Also:
-
TYPE_NPM
- See Also:
-
TYPE_GENERIC
- See Also:
-
-
Method Details
-
maven
Creates a Maven PURL withtype=jarqualifier.- Parameters:
groupId- Maven groupId (used as namespace)artifactId- Maven artifactId (used as name)version- artifact version- Returns:
- a Maven PURL
-
maven
public static Purl maven(String groupId, String artifactId, String version, String artifactType, String classifier) Creates a Maven PURL with explicit type and classifier qualifiers.- Parameters:
groupId- Maven groupId (used as namespace)artifactId- Maven artifactId (used as name)version- artifact versionartifactType- Maven artifact type (e.g., "jar", "war")classifier- Maven classifier, or null- Returns:
- a Maven PURL
-
npm
Creates an npm PURL.- Parameters:
namespace- the npm scope (e.g., "@babel"), or null for unscoped packagesname- the package nameversion- the package version- Returns:
- an npm PURL
-
generic
Creates a generic PURL with no namespace or qualifiers.- Parameters:
name- the component nameversion- the component version- Returns:
- a generic PURL
-
of
Creates a PURL with the specified type.- Parameters:
type- the package ecosystem typenamespace- the namespace, or nullname- the package nameversion- the version, or null- Returns:
- a PURL
-
builder
-
parse
Parses a canonical PURL string.- Parameters:
purlString- a PURL string starting with "pkg:"- Returns:
- the parsed Purl
- Throws:
IllegalArgumentException- if the string is not a valid PURL
-
getType
-
getNamespace
-
getName
-
getVersion
-
getQualifiers
-
getSubpath
-
toString
Returns the canonical PURL string representation. -
equals
-
hashCode
public int hashCode()
-