Package com.google.errorprone.matchers
Class Description.Builder
java.lang.Object
com.google.errorprone.matchers.Description.Builder
- Enclosing class:
- Description
public static class Description.Builder extends Object
Builder for
Description
s.-
Method Summary
Modifier and Type Method Description Description.Builder
addAllFixes(List<? extends Fix> fixes)
Add each fix in order.Description.Builder
addFix(Fix fix)
Adds a suggested fix for thisDescription
.Description.Builder
addFix(Optional<? extends Fix> fix)
Deprecated.Description
build()
Description.Builder
setLinkUrl(String linkUrl)
Set a custom link URL.Description.Builder
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. -
build
-
SuggestedFix.emptyFix()
.