public static class Description.Builder extends Object
Description
s.Modifier and Type | Method and Description |
---|---|
Description.Builder |
addAllFixes(List<? extends Fix> fixes)
Add each fix in order.
|
Description.Builder |
addFix(Fix fix)
Adds a suggested fix for this
Description . |
Description.Builder |
addFix(Optional<? extends Fix> fix)
Deprecated.
prefer referring to empty fixes using
SuggestedFix.emptyFix() . |
Description |
build() |
Description.Builder |
setLinkUrl(String linkUrl)
Set a custom link URL.
|
Description.Builder |
setMessage(String message)
Set a custom error message for this
Description . |
public Description.Builder addFix(Fix fix)
Description
. Fixes should be added in order of
decreasing preference. Adding an empty fix is a no-op.fix
- a suggested fix for this problemNullPointerException
- if fix
is null
@Deprecated public Description.Builder addFix(Optional<? extends Fix> fix)
SuggestedFix.emptyFix()
.Description
if fix
is present. Fixes should be
added in order of decreasing preference. Adding an empty fix is a no-op.fix
- a suggested fix for this problemNullPointerException
- if fix
is null
public Description.Builder addAllFixes(List<? extends Fix> fixes)
fixes
- a list of suggested fixes for this problemNullPointerException
- if fixes
or any of its elements are null
public Description.Builder setMessage(String message)
Description
. The custom message will be used
instead of the summary field as the text for the diagnostic message.message
- A custom error message without the check name ("[checkname]") or linkpublic Description.Builder setLinkUrl(String linkUrl)
@
BugPattern.public Description build()
Copyright © 2021 Google LLC. All rights reserved.