Class GenericIdentifier
- java.lang.Object
-
- org.owasp.dependencycheck.dependency.naming.GenericIdentifier
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Identifier>,Identifier
@ThreadSafe public class GenericIdentifier extends java.lang.Object implements Identifier
In identifier such as a CPE or dependency coordinates (i.e. GAV).- Author:
- Jeremy Long
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericIdentifier(java.lang.String value, java.lang.String url, Confidence confidence)Constructs a new Identifier with the specified data.GenericIdentifier(java.lang.String value, Confidence confidence)Constructs a new Identifier with the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull Identifier o)Implementation of the comparator interface.booleanequals(java.lang.Object obj)Basic implementation of equals.ConfidencegetConfidence()Get the value of confidence.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()Basic implementation of hasCode.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()Standard implementation of toString; displays identifier value and type.
-
-
-
Constructor Detail
-
GenericIdentifier
public GenericIdentifier(java.lang.String value, Confidence confidence)Constructs a new Identifier with the specified data.- Parameters:
value- the identifier valueconfidence- the confidence level that the identifier is correct
-
GenericIdentifier
public GenericIdentifier(java.lang.String value, java.lang.String url, Confidence confidence)Constructs a new Identifier with the specified data.- Parameters:
confidence- the confidence level that the identifier is correctvalue- the identifier valueurl- the identifier URL
-
-
Method Detail
-
getConfidence
public Confidence getConfidence()
Get the value of confidence.- Specified by:
getConfidencein interfaceIdentifier- Returns:
- the value of confidence
-
getValue
public java.lang.String getValue()
Get the string representation of the Identifier.- Specified by:
getValuein interfaceIdentifier- Returns:
- the value of notes
-
getUrl
public java.lang.String getUrl()
Get the value of URL.- Specified by:
getUrlin interfaceIdentifier- Returns:
- the value of URL
-
getNotes
public java.lang.String getNotes()
Get the value of notes from suppression notes.- Specified by:
getNotesin interfaceIdentifier- Returns:
- the value of notes
-
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)
Set the value of notes.- Specified by:
setNotesin interfaceIdentifier- Parameters:
notes- new value of notes
-
equals
public boolean equals(java.lang.Object obj)
Basic implementation of equals.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the identifier to compare- Returns:
- true if the objects are equal
-
hashCode
public int hashCode()
Basic implementation of hasCode.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hash code
-
toString
public java.lang.String toString()
Standard implementation of toString; displays identifier value and type.- Overrides:
toStringin classjava.lang.Object- Returns:
- a String representation of the object
-
compareTo
public int compareTo(@NotNull @NotNull Identifier o)Implementation of the comparator interface.- Specified by:
compareToin interfacejava.lang.Comparable<Identifier>- Parameters:
o- the object being compared- Returns:
- an integer indicating the ordering
-
-