Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 46 additions & 46 deletions src/main/java/com/github/packageurl/PackageURL.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,52 @@ public final class PackageURL implements Serializable {

private static final char PERCENT_CHAR = '%';

/**
* The PackageURL scheme constant
*/
public static final String SCHEME = "pkg";

/**
* The PackageURL scheme ({@code "pkg"}) constant followed by a colon ({@code ':'}).
*/
private static final String SCHEME_PART = SCHEME + ':';

/**
* The package "type" or package "protocol" such as maven, npm, nuget, gem, pypi, etc.
* Required.
*/
private String type;

/**
* The name prefix such as a Maven groupid, a Docker image owner, a GitHub user or organization.
* Optional and type-specific.
*/
private @Nullable String namespace;

/**
* The name of the package.
* Required.
*/
private String name;

/**
* The version of the package.
* Optional.
*/
private @Nullable String version;

/**
* Extra qualifying data for a package such as an OS, architecture, a distro, etc.
* Optional and type-specific.
*/
private @Nullable Map<String, String> qualifiers;

/**
* Extra subpath within a package, relative to the package root.
* Optional.
*/
private @Nullable String subpath;

/**
* Constructs a new PackageURL object by parsing the specified string.
*
Expand Down Expand Up @@ -141,52 +187,6 @@ public PackageURL(
this(type, namespace, name, version, (qualifiers != null) ? new TreeMap<>(qualifiers) : null, subpath);
}

/**
* The PackageURL scheme constant
*/
public static final String SCHEME = "pkg";

/**
* The PackageURL scheme ({@code "pkg"}) constant followed by a colon ({@code ':'}).
*/
private static final String SCHEME_PART = SCHEME + ':';

/**
* The package "type" or package "protocol" such as maven, npm, nuget, gem, pypi, etc.
* Required.
*/
private String type;

/**
* The name prefix such as a Maven groupid, a Docker image owner, a GitHub user or organization.
* Optional and type-specific.
*/
private @Nullable String namespace;

/**
* The name of the package.
* Required.
*/
private String name;

/**
* The version of the package.
* Optional.
*/
private @Nullable String version;

/**
* Extra qualifying data for a package such as an OS, architecture, a distro, etc.
* Optional and type-specific.
*/
private @Nullable Map<String, String> qualifiers;

/**
* Extra subpath within a package, relative to the package root.
* Optional.
*/
private @Nullable String subpath;

/**
* Converts this {@link PackageURL} to a {@link PackageURLBuilder}.
*
Expand Down