Class NodeMessage.List

java.lang.Object
uk.blankaspect.common.basictree.NodeMessage.List
Enclosing class:
NodeMessage

public static class NodeMessage.List extends Object
This class implements a list of node-related messages.
  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns true 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()
      Returns true 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

      public List<NodeMessage> getMessages()
      Returns an unmodifiable list of the messages in this list.
      Returns:
      an unmodifiable list of the messages in this list.
    • add

      public void add(AbstractNode node, NodeMessage.Kind kind, String text, 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 be null.
      replacements - the text that will replace placeholders in text.
      Throws:
      IllegalArgumentException - if node is null or kind is null.
    • add

      public void add(AbstractNode node, NodeMessage.Kind kind, Throwable exception)
      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 be null.
      Throws:
      IllegalArgumentException - if node is null or kind is null.
    • 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 be null.
      exception - the exception that will be associated with the message, which may be null.
      replacements - the text that will replace placeholders in text.
      Throws:
      IllegalArgumentException - if node is null or kind is null.