Class 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.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GenericIdentifier

        public GenericIdentifier​(java.lang.String value,
                                 Confidence confidence)
        Constructs a new Identifier with the specified data.
        Parameters:
        value - the identifier value
        confidence - 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 correct
        value - the identifier value
        url - the identifier URL
    • Method Detail

      • getConfidence

        public Confidence getConfidence()
        Get the value of confidence.
        Specified by:
        getConfidence in interface Identifier
        Returns:
        the value of confidence
      • getValue

        public java.lang.String getValue()
        Get the string representation of the Identifier.
        Specified by:
        getValue in interface Identifier
        Returns:
        the value of notes
      • getUrl

        public java.lang.String getUrl()
        Get the value of URL.
        Specified by:
        getUrl in interface Identifier
        Returns:
        the value of URL
      • getNotes

        public java.lang.String getNotes()
        Get the value of notes from suppression notes.
        Specified by:
        getNotes in interface Identifier
        Returns:
        the value of notes
      • setConfidence

        public void setConfidence​(Confidence confidence)
        Set the value of confidence.
        Specified by:
        setConfidence in interface Identifier
        Parameters:
        confidence - the value of confidence
      • setUrl

        public void setUrl​(java.lang.String url)
        Set the value of URL.
        Specified by:
        setUrl in interface Identifier
        Parameters:
        url - the value of URL
      • setNotes

        public void setNotes​(java.lang.String notes)
        Set the value of notes.
        Specified by:
        setNotes in interface Identifier
        Parameters:
        notes - new value of notes
      • equals

        public boolean equals​(java.lang.Object obj)
        Basic implementation of equals.
        Overrides:
        equals in class java.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 class java.lang.Object
        Returns:
        the hash code
      • toString

        public java.lang.String toString()
        Standard implementation of toString; displays identifier value and type.
        Overrides:
        toString in class java.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 interface java.lang.Comparable<Identifier>
        Parameters:
        o - the object being compared
        Returns:
        an integer indicating the ordering