Class BugDesignation

  • All Implemented Interfaces:
    XMLWriteable, java.io.Serializable, java.lang.Comparable<BugDesignation>

    public class BugDesignation
    extends java.lang.Object
    implements XMLWriteable, java.io.Serializable, java.lang.Comparable<BugDesignation>
    class to hold the user annotation and user designation for a BugInstance
    See Also:
    Serialized Form
    • Field Detail

      • UNCLASSIFIED

        public static final java.lang.String UNCLASSIFIED
        The default key for the user designation. Bad things could happen if this key isn't in getUserDesignations()
    • Constructor Detail

      • BugDesignation

        public BugDesignation()
      • BugDesignation

        public BugDesignation​(java.lang.String designation,
                              long timestamp,
                              java.lang.String annotationText,
                              java.lang.String user)
        Parameters:
        designation -
        timestamp -
        annotationText -
        user -
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isDirty

        public boolean isDirty()
      • cleanDirty

        public void cleanDirty()
      • setDirty

        public void setDirty​(boolean dirty)
      • getDesignationKey

        @Nonnull
        public java.lang.String getDesignationKey()
        return the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc. Note that this is the key, suitable for writing to XML, but not for showing to the user.
        See Also:
        I18N.getUserDesignation(String key)
      • hasDesignationKey

        public boolean hasDesignationKey()
      • setDesignationKey

        public void setDesignationKey​(java.lang.String designationKey)
        set the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc. If the argument is null, it will be treated as UNCLASSIFIED. Note that this is the key, suitable for writing to XML, but not what the user sees. Strange things could happen if designationKey is not one of the keys returned by I18N.instance().getUserDesignations().
        See Also:
        I18N.getUserDesignationKeys()
      • getUser

        @CheckForNull
        public java.lang.String getUser()
      • setUser

        public void setUser​(java.lang.String u)
      • getTimestamp

        public long getTimestamp()
      • setTimestamp

        public void setTimestamp​(long ts)
      • getAnnotationText

        @CheckForNull
        public java.lang.String getAnnotationText()
      • hasAnnotationText

        public boolean hasAnnotationText()
      • getNonnullAnnotationText

        @Nonnull
        public java.lang.String getNonnullAnnotationText()
      • setAnnotationText

        public void setAnnotationText​(java.lang.String s)
      • writeXML

        public void writeXML​(XMLOutput xmlOutput)
                      throws java.io.IOException
        Description copied from interface: XMLWriteable
        Write this object to given XMLOutput.
        Specified by:
        writeXML in interface XMLWriteable
        Parameters:
        xmlOutput - the XMLOutput for the document
        Throws:
        java.io.IOException
      • merge

        public void merge​(@CheckForNull
                          BugDesignation other)
        replace unset fields of this user designation with values set in the other
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object