Package edu.umd.cs.findbugs
Class BugDesignation
- java.lang.Object
-
- edu.umd.cs.findbugs.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 Summary
Fields Modifier and Type Field Description static java.lang.StringUNCLASSIFIEDThe default key for the user designation.
-
Constructor Summary
Constructors Constructor Description BugDesignation()BugDesignation(BugDesignation that)BugDesignation(java.lang.String designation, long timestamp, java.lang.String annotationText, java.lang.String user)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanDirty()intcompareTo(BugDesignation o)booleanequals(java.lang.Object o)java.lang.StringgetAnnotationText()java.lang.StringgetDesignationKey()return the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc.java.lang.StringgetNonnullAnnotationText()longgetTimestamp()java.lang.StringgetUser()booleanhasAnnotationText()booleanhasDesignationKey()inthashCode()booleanisDirty()voidmerge(BugDesignation other)replace unset fields of this user designation with values set in the othervoidsetAnnotationText(java.lang.String s)voidsetDesignationKey(java.lang.String designationKey)set the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc.voidsetDirty(boolean dirty)voidsetTimestamp(long ts)voidsetUser(java.lang.String u)java.lang.StringtoString()voidwriteXML(XMLOutput xmlOutput)Write this object to given XMLOutput.
-
-
-
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-
-
BugDesignation
public BugDesignation(BugDesignation that)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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:XMLWriteableWrite this object to given XMLOutput.- Specified by:
writeXMLin interfaceXMLWriteable- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(BugDesignation o)
- Specified by:
compareToin interfacejava.lang.Comparable<BugDesignation>
-
-