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 int
compareTo(@NotNull Identifier o)
Implementation of the comparator interface.boolean
equals(java.lang.Object obj)
Basic implementation of equals.Confidence
getConfidence()
Get the value of confidence.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()
Basic implementation of hasCode.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()
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:
getConfidence
in interfaceIdentifier
- Returns:
- the value of confidence
-
getValue
public java.lang.String getValue()
Get the string representation of the Identifier.- Specified by:
getValue
in interfaceIdentifier
- Returns:
- the value of notes
-
getUrl
public java.lang.String getUrl()
Get the value of URL.- Specified by:
getUrl
in interfaceIdentifier
- Returns:
- the value of URL
-
getNotes
public java.lang.String getNotes()
Get the value of notes from suppression notes.- Specified by:
getNotes
in interfaceIdentifier
- Returns:
- the value of notes
-
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)
Set the value of notes.- Specified by:
setNotes
in interfaceIdentifier
- Parameters:
notes
- new value of notes
-
equals
public boolean equals(java.lang.Object obj)
Basic implementation of equals.- Overrides:
equals
in 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:
hashCode
in classjava.lang.Object
- Returns:
- the hash code
-
toString
public java.lang.String toString()
Standard implementation of toString; displays identifier value and type.- Overrides:
toString
in 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:
compareTo
in interfacejava.lang.Comparable<Identifier>
- Parameters:
o
- the object being compared- Returns:
- an integer indicating the ordering
-
-