Class PurlIdentifier
java.lang.Object
org.owasp.dependencycheck.dependency.naming.PurlIdentifier
- All Implemented Interfaces:
Serializable, Comparable<Identifier>, Identifier
The Package-URL Identifier implementation.
- Author:
- Jeremy Long
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPurlIdentifier(com.github.packageurl.PackageURL purl, String url, Confidence confidence) Constructs a new Package-URL identifier.PurlIdentifier(com.github.packageurl.PackageURL purl, Confidence confidence) Constructs a new Package-URL identifier.PurlIdentifier(String type, String namespace, String name, String version, Confidence confidence) Constructs a new Package-URL identifier.PurlIdentifier(String type, String name, String version, Confidence confidence) Constructs a new Package-URL identifier. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NonNull Identifier o) booleanGet the value of confidence.getName()Returns the Package URL name.Returns the Package URL name space.getNotes()Get the value of notes from suppression notes.getUrl()Get the value of URL.getValue()Get the string representation of the Identifier.Returns the Package URL version.inthashCode()voidsetConfidence(Confidence confidence) Set the value of confidence.voidSet the value of notes.voidSet the value of URL.toGav()Returns the GAV representation of the Package URL as utilized in gradle builds.toString()Returns the CPE 2.3 formatted string.
-
Constructor Details
-
PurlIdentifier
Constructs a new Package-URL identifier.- Parameters:
purl- the Package-URL objectconfidence- the confidence that the identifier is correct for the given dependency
-
PurlIdentifier
Constructs a new Package-URL identifier.- Parameters:
purl- the Package-URL objecturl- the URL for the identifierconfidence- the confidence that the identifier is correct for the given dependency
-
PurlIdentifier
public PurlIdentifier(String type, String name, String version, Confidence confidence) throws com.github.packageurl.MalformedPackageURLException Constructs a new Package-URL identifier.- Parameters:
type- the type of package-URLname- the nameversion- the versionconfidence- the confidence that the identifier is correct for the given dependency- Throws:
com.github.packageurl.MalformedPackageURLException- thrown if the type, name space, name, and version cannot be converted into a package-URL
-
PurlIdentifier
public PurlIdentifier(String type, String namespace, String name, String version, Confidence confidence) throws com.github.packageurl.MalformedPackageURLException Constructs a new Package-URL identifier.- Parameters:
type- the type of package-URLnamespace- the name spacename- the nameversion- the versionconfidence- the confidence that the identifier is correct for the given dependency- Throws:
com.github.packageurl.MalformedPackageURLException- thrown if the type, name space, name, and version cannot be converted into a package-URL
-
-
Method Details
-
getConfidence
Description copied from interface:IdentifierGet the value of confidence.- Specified by:
getConfidencein interfaceIdentifier- Returns:
- the value of confidence
-
getNotes
Description copied from interface:IdentifierGet the value of notes from suppression notes.- Specified by:
getNotesin interfaceIdentifier- Returns:
- the value of notes
-
getUrl
Description copied from interface:IdentifierGet the value of URL.- Specified by:
getUrlin interfaceIdentifier- Returns:
- the value of URL
-
setConfidence
Set the value of confidence.- Specified by:
setConfidencein interfaceIdentifier- Parameters:
confidence- the value of confidence
-
setUrl
Set the value of URL.- Specified by:
setUrlin interfaceIdentifier- Parameters:
url- the value of URL
-
setNotes
Description copied from interface:IdentifierSet the value of notes.- Specified by:
setNotesin interfaceIdentifier- Parameters:
notes- new value of notes
-
toString
-
getValue
Description copied from interface:IdentifierGet the string representation of the Identifier.- Specified by:
getValuein interfaceIdentifier- Returns:
- the value of notes
-
getNamespace
Returns the Package URL name space.- Returns:
- the Package URL name space
-
getName
-
getVersion
Returns the Package URL version.- Returns:
- the Package URL name.
- See Also:
-
toGav
Returns the GAV representation of the Package URL as utilized in gradle builds.- Returns:
- the GAV representation of the Package URL
-
compareTo
- Specified by:
compareToin interfaceComparable<Identifier>
-
hashCode
-
equals
-