public final class PackageURLBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
static PackageURLBuilder |
aPackageURL()
Obtain a reference to a new builder object.
|
PackageURL |
build()
Builds the new PackageURL object.
|
PackageURLBuilder |
withName(String name)
Adds the package name.
|
PackageURLBuilder |
withNamespace(String namespace)
Adds the package namespace.
|
PackageURLBuilder |
withQualifier(String key,
String value)
Adds a package qualifier.
|
PackageURLBuilder |
withSubpath(String subpath)
Adds the package subpath.
|
PackageURLBuilder |
withType(String type)
Adds the package URL type.
|
PackageURLBuilder |
withVersion(String version)
Adds the package version.
|
public static PackageURLBuilder aPackageURL()
public PackageURLBuilder withType(String type)
type - the package typePackageURL.getName(),
PackageURL.StandardTypespublic PackageURLBuilder withNamespace(String namespace)
namespace - the package namespacePackageURL.getNamespace()public PackageURLBuilder withName(String name)
name - the package namePackageURL.getName()public PackageURLBuilder withVersion(String version)
version - the package versionPackageURL.getVersion()public PackageURLBuilder withSubpath(String subpath)
subpath - the package subpathPackageURL.getSubpath()public PackageURLBuilder withQualifier(String key, String value)
key - the package qualifier keyvalue - the package qualifier valuePackageURL.getQualifiers()public PackageURL build() throws MalformedPackageURLException
MalformedPackageURLException - thrown if the type or name has not been specified or if a field fails validationCopyright © 2017–2019. All rights reserved.