Class CpeIdentifier
- java.lang.Object
-
- org.owasp.dependencycheck.dependency.naming.CpeIdentifier
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Identifier>
,Identifier
public class CpeIdentifier extends java.lang.Object implements Identifier
A CPE Identifier for a dependency object.- Author:
- Jeremy Long
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CpeIdentifier(java.lang.String vendor, java.lang.String product, java.lang.String version, Confidence confidence)
Constructs a new CPE Identifier from a CPE object with the given confidence.CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, java.lang.String url, Confidence confidence)
Constructs a new CPE Identifier from a CPE object with the given confidence.CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, Confidence confidence)
Constructs a new CPE Identifier from a CPE object with the given confidence.
-
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.us.springett.parsers.cpe.Cpe
getCpe()
Returns the CPE object.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.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
toString()
Returns the CPE 2.3 formatted string.
-
-
-
Constructor Detail
-
CpeIdentifier
public CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, Confidence confidence)
Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
cpe
- the CPE valueconfidence
- the confidence in the identifiers match
-
CpeIdentifier
public CpeIdentifier(us.springett.parsers.cpe.Cpe cpe, java.lang.String url, Confidence confidence)
Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
cpe
- the CPE valueurl
- the URL for the identifierconfidence
- the confidence in the identifiers match
-
CpeIdentifier
public CpeIdentifier(java.lang.String vendor, java.lang.String product, java.lang.String version, Confidence confidence) throws us.springett.parsers.cpe.exceptions.CpeValidationException
Constructs a new CPE Identifier from a CPE object with the given confidence.- Parameters:
vendor
- the vendorproduct
- the product nameversion
- the versionconfidence
- the confidence in the identifiers match- Throws:
us.springett.parsers.cpe.exceptions.CpeValidationException
- thrown if there is an error converting the vendor, product, and version into a CPE object
-
-
Method Detail
-
getCpe
public us.springett.parsers.cpe.Cpe getCpe()
Returns the CPE object.- Returns:
- the CPE object
-
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
-
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
-
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
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull Identifier o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Identifier>
-
-