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 intcompareTo(@NotNull Identifier o)booleanequals(java.lang.Object obj)ConfidencegetConfidence()Get the value of confidence.us.springett.parsers.cpe.CpegetCpe()Returns the CPE object.java.lang.StringgetNotes()Get the value of notes from suppression notes.java.lang.StringgetUrl()Get the value of URL.java.lang.StringgetValue()Get the string representation of the Identifier.inthashCode()voidsetConfidence(Confidence confidence)Set the value of confidence.voidsetNotes(java.lang.String notes)Set the value of notes.voidsetUrl(java.lang.String url)Set the value of URL.java.lang.StringtoString()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.CpeValidationExceptionConstructs 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:IdentifierGet the value of confidence.- Specified by:
getConfidencein interfaceIdentifier- Returns:
- the value of confidence
-
getNotes
public java.lang.String getNotes()
Description copied from interface:IdentifierGet the value of notes from suppression notes.- Specified by:
getNotesin interfaceIdentifier- Returns:
- the value of notes
-
getUrl
public java.lang.String getUrl()
Description copied from interface:IdentifierGet the value of URL.- Specified by:
getUrlin interfaceIdentifier- Returns:
- the value of URL
-
setConfidence
public void setConfidence(Confidence confidence)
Set the value of confidence.- Specified by:
setConfidencein interfaceIdentifier- Parameters:
confidence- the value of confidence
-
setUrl
public void setUrl(java.lang.String url)
Set the value of URL.- Specified by:
setUrlin interfaceIdentifier- Parameters:
url- the value of URL
-
setNotes
public void setNotes(java.lang.String notes)
Description copied from interface:IdentifierSet the value of notes.- Specified by:
setNotesin interfaceIdentifier- Parameters:
notes- new value of notes
-
getValue
public java.lang.String getValue()
Description copied from interface:IdentifierGet the string representation of the Identifier.- Specified by:
getValuein interfaceIdentifier- Returns:
- the value of notes
-
toString
public java.lang.String toString()
Returns the CPE 2.3 formatted string.- Overrides:
toStringin classjava.lang.Object- Returns:
- the CPE 2.3 formatted string
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull Identifier o)- Specified by:
compareToin interfacejava.lang.Comparable<Identifier>
-
-