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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(AbstractNode node, NodeMessage.Kind kind, String text, Object... replacements) Creates a new message with the specified attributes and adds it to this list.voidadd(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.voidadd(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.intReturns the number of messages in this list.booleanReturnstrueif this list contains at least one 'fatal error' message.booleanisEmpty()Returnstrueif 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()Returnstrueif this list contains no messages.- Returns:
trueif this list contains no messages;falseotherwise.
-
getNumMessages
public int getNumMessages()Returns the number of messages in this list.- Returns:
- the number of messages in this list.
-
hasFatalError
public boolean hasFatalError()Returnstrueif this list contains at least one 'fatal error' message.- Returns:
trueif this list contains at least one 'fatal error' message;falseotherwise.
-
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- ifnodeisnullorkindisnull.
-
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- ifnodeisnullorkindisnull.
-
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- ifnodeisnullorkindisnull.
-