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.String
UNCLASSIFIED
The 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 void
cleanDirty()
int
compareTo(BugDesignation o)
boolean
equals(java.lang.Object o)
java.lang.String
getAnnotationText()
java.lang.String
getDesignationKey()
return the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc.java.lang.String
getNonnullAnnotationText()
long
getTimestamp()
java.lang.String
getUser()
boolean
hasAnnotationText()
boolean
hasDesignationKey()
int
hashCode()
boolean
isDirty()
void
merge(BugDesignation other)
replace unset fields of this user designation with values set in the othervoid
setAnnotationText(java.lang.String s)
void
setDesignationKey(java.lang.String designationKey)
set the user designation E.g., "MOSTLY_HARMLESS", "CRITICAL", "NOT_A_BUG", etc.void
setDirty(boolean dirty)
void
setTimestamp(long ts)
void
setUser(java.lang.String u)
java.lang.String
toString()
void
writeXML(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:
toString
in 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:XMLWriteable
Write this object to given XMLOutput.- Specified by:
writeXML
in 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(BugDesignation o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<BugDesignation>
-
-