Package uk.blankaspect.common.basictree
Class NodeMessage.List
java.lang.Object
uk.blankaspect.common.basictree.NodeMessage.List
- Enclosing class:
- NodeMessage
This class implements a list of node-related messages.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(AbstractNode node, NodeMessage.Kind kind, String text, Object... replacements) Creates a new message with the specified attributes and adds it to this list.void
add
(AbstractNode node, NodeMessage.Kind kind, String text, Throwable exception, Object... replacements) Creates a new message with the specified attributes and adds it to this list.void
add
(AbstractNode node, NodeMessage.Kind kind, Throwable exception) Creates a new message with the specified attributes and adds it to this list.Returns an unmodifiable list of the messages in this list.int
Returns the number of messages in this list.boolean
Returnstrue
if this list contains at least one 'fatal error' message.boolean
isEmpty()
Returnstrue
if this list contains no messages.
-
Constructor Details
-
List
public List()Creates a new instance of a list of node-related messages.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returnstrue
if this list contains no messages.- Returns:
true
if this list contains no messages;false
otherwise.
-
getNumMessages
public int getNumMessages()Returns the number of messages in this list.- Returns:
- the number of messages in this list.
-
hasFatalError
public boolean hasFatalError()Returnstrue
if this list contains at least one 'fatal error' message.- Returns:
true
if this list contains at least one 'fatal error' message;false
otherwise.
-
getMessages
Returns an unmodifiable list of the messages in this list.- Returns:
- an unmodifiable list of the messages in this list.
-
add
Creates a new message with the specified attributes and adds it to this list.- Parameters:
node
- the node that will be associated with the message.kind
- the kind of the message.text
- the text of the message, which may benull
.replacements
- the text that will replace placeholders intext
.- Throws:
IllegalArgumentException
- ifnode
isnull
orkind
isnull
.
-
add
Creates a new message with the specified attributes and adds it to this list.- Parameters:
node
- the node that will be associated with the message.kind
- the kind of the message.exception
- the exception that will be associated with the message, which may benull
.- Throws:
IllegalArgumentException
- ifnode
isnull
orkind
isnull
.
-
add
public void add(AbstractNode node, NodeMessage.Kind kind, String text, Throwable exception, Object... replacements) Creates a new message with the specified attributes and adds it to this list.- Parameters:
node
- the node that will be associated with the message.kind
- the kind of the message.text
- the text of the message, which may benull
.exception
- the exception that will be associated with the message, which may benull
.replacements
- the text that will replace placeholders intext
.- Throws:
IllegalArgumentException
- ifnode
isnull
orkind
isnull
.
-