Class Description.Builder
java.lang.Object
com.google.errorprone.matchers.Description.Builder
- Enclosing class:
Description
Builder for
Description
s.- Author:
- alexeagle@google.com (Alex Eagle)
-
Method Summary
Modifier and TypeMethodDescriptionaddAllFixes
(List<? extends Fix> fixes) Add each fix in order.Adds a suggested fix for thisDescription
.Deprecated.build()
overrideSeverity
(BugPattern.SeverityLevel severity) setLinkUrl
(String linkUrl) Set a custom link URL.setMessage
(String message) Set a custom error message for thisDescription
.
-
Method Details
-
addFix
Adds a suggested fix for thisDescription
. Fixes should be added in order of decreasing preference. Adding an empty fix is a no-op.- Parameters:
fix
- a suggested fix for this problem- Throws:
NullPointerException
- iffix
isnull
-
addFix
Deprecated.prefer referring to empty fixes usingSuggestedFix.emptyFix()
.Adds a suggested fix for thisDescription
iffix
is present. Fixes should be added in order of decreasing preference. Adding an empty fix is a no-op.- Parameters:
fix
- a suggested fix for this problem- Throws:
NullPointerException
- iffix
isnull
-
addAllFixes
Add each fix in order.- Parameters:
fixes
- a list of suggested fixes for this problem- Throws:
NullPointerException
- iffixes
or any of its elements arenull
-
setMessage
Set a custom error message for thisDescription
. The custom message will be used instead of the summary field as the text for the diagnostic message.- Parameters:
message
- A custom error message without the check name ("[checkname]") or link
-
setLinkUrl
Set a custom link URL. The custom URL will be used instead of the default one which forms part of the@
BugPattern. -
overrideSeverity
@CanIgnoreReturnValue public Description.Builder overrideSeverity(BugPattern.SeverityLevel severity) -
build
-
SuggestedFix.emptyFix()
.