Class DiagMessage
java.lang.Object
org.checkerframework.framework.source.DiagMessage
A
DiagMessage
is a kind, a message key, and arguments. The message key will be expanded
according to the user locale. Any arguments will then be interpolated into the localized message.
By contrast, javax.tools.Diagnostic
has just a string message.
-
Constructor Summary
ConstructorDescriptionDiagMessage
(Diagnostic.Kind kind, @CompilerMessageKey String messageKey, Object... args) Create a DiagMessage. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static DiagMessage
error
(@CompilerMessageKey String messageKey, Object... args) Create a DiagMessage with kind ERROR.Object[]
getArgs()
Returns the customized optional arguments for the message.getKind()
Returns the kind of this DiagMessage.Returns the message key of this DiagMessage.int
hashCode()
static @Nullable List
<DiagMessage> mergeLists
(@Nullable List<DiagMessage> list1, @Nullable List<DiagMessage> list2) Returns the concatenation of the lists.toString()
-
Constructor Details
-
DiagMessage
Create a DiagMessage.- Parameters:
kind
- the kind of messagemessageKey
- the message keyargs
- the arguments that will be interpolated into the localized message
-
-
Method Details
-
error
Create a DiagMessage with kind ERROR.- Parameters:
messageKey
- the message keyargs
- the arguments that will be interpolated into the localized message- Returns:
- a new DiagMessage
-
getKind
Returns the kind of this DiagMessage.- Returns:
- the kind of this DiagMessage
-
getMessageKey
Returns the message key of this DiagMessage.- Returns:
- the message key of this DiagMessage
-
getArgs
Returns the customized optional arguments for the message.- Returns:
- the customized optional arguments for the message
-
equals
-
hashCode
-
toString
-
mergeLists
public static @Nullable List<DiagMessage> mergeLists(@Nullable List<DiagMessage> list1, @Nullable List<DiagMessage> list2) Returns the concatenation of the lists.- Parameters:
list1
- a list of DiagMessage, or nulllist2
- a list of DiagMessage, or null- Returns:
- the concatenation of the lists
-