Class PurlIdentifier
- java.lang.Object
-
- org.owasp.dependencycheck.dependency.naming.PurlIdentifier
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Identifier>
,Identifier
public class PurlIdentifier extends java.lang.Object implements Identifier
The Package-URL Identifier implementation.- Author:
- Jeremy Long
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PurlIdentifier(com.github.packageurl.PackageURL purl, java.lang.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(java.lang.String type, java.lang.String namespace, java.lang.String name, java.lang.String version, Confidence confidence)
Constructs a new Package-URL identifier.PurlIdentifier(java.lang.String type, java.lang.String name, java.lang.String version, Confidence confidence)
Constructs a new Package-URL identifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(@NotNull Identifier o)
boolean
equals(java.lang.Object obj)
Confidence
getConfidence()
Get the value of confidence.java.lang.String
getName()
Returns the Package URL name.java.lang.String
getNamespace()
Returns the Package URL name space.java.lang.String
getNotes()
Get the value of notes from suppression notes.java.lang.String
getUrl()
Get the value of URL.java.lang.String
getValue()
Get the string representation of the Identifier.java.lang.String
getVersion()
Returns the Package URL version.int
hashCode()
void
setConfidence(Confidence confidence)
Set the value of confidence.void
setNotes(java.lang.String notes)
Set the value of notes.void
setUrl(java.lang.String url)
Set the value of URL.java.lang.String
toGav()
Returns the GAV representation of the Package URL as utilized in gradle builds.java.lang.String
toString()
Returns the CPE 2.3 formatted string.
-
-
-
Constructor Detail
-
PurlIdentifier
public PurlIdentifier(com.github.packageurl.PackageURL purl, Confidence confidence)
Constructs a new Package-URL identifier.- Parameters:
purl
- the Package-URL objectconfidence
- the confidence that the identifier is correct for the given dependency
-
PurlIdentifier
public PurlIdentifier(com.github.packageurl.PackageURL purl, java.lang.String url, Confidence confidence)
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(java.lang.String type, java.lang.String name, java.lang.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(java.lang.String type, java.lang.String namespace, java.lang.String name, java.lang.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 Detail
-
getConfidence
public Confidence getConfidence()
Description copied from interface:Identifier
Get the value of confidence.- Specified by:
getConfidence
in interfaceIdentifier
- Returns:
- the value of confidence
-
getNotes
public java.lang.String getNotes()
Description copied from interface:Identifier
Get the value of notes from suppression notes.- Specified by:
getNotes
in interfaceIdentifier
- Returns:
- the value of notes
-
getUrl
public java.lang.String getUrl()
Description copied from interface:Identifier
Get the value of URL.- Specified by:
getUrl
in interfaceIdentifier
- Returns:
- the value of URL
-
setConfidence
public void setConfidence(Confidence confidence)
Set the value of confidence.- Specified by:
setConfidence
in interfaceIdentifier
- Parameters:
confidence
- the value of confidence
-
setUrl
public void setUrl(java.lang.String url)
Set the value of URL.- Specified by:
setUrl
in interfaceIdentifier
- Parameters:
url
- the value of URL
-
setNotes
public void setNotes(java.lang.String notes)
Description copied from interface:Identifier
Set the value of notes.- Specified by:
setNotes
in interfaceIdentifier
- Parameters:
notes
- new value of notes
-
toString
public java.lang.String toString()
Returns the CPE 2.3 formatted string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the CPE 2.3 formatted string
-
getValue
public java.lang.String getValue()
Description copied from interface:Identifier
Get the string representation of the Identifier.- Specified by:
getValue
in interfaceIdentifier
- Returns:
- the value of notes
-
getNamespace
public java.lang.String getNamespace()
Returns the Package URL name space.- Returns:
- the Package URL name space
-
getName
public java.lang.String getName()
Returns the Package URL name.- Returns:
- the Package URL name.
- See Also:
PackageURL.getName()
-
getVersion
public java.lang.String getVersion()
Returns the Package URL version.- Returns:
- the Package URL name.
- See Also:
PackageURL.getVersion()
-
toGav
public java.lang.String toGav()
Returns the GAV representation of the Package URL as utilized in gradle builds.- Returns:
- the GAV representation of the Package URL
-
compareTo
public int compareTo(@NotNull @NotNull Identifier o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Identifier>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-