Class MessagePatterns

java.lang.Object
eu.bandm.tools.message.MessagePatterns

public class MessagePatterns extends Object
Paisley patterns for messages.
  • Method Details

    • mKind

      public Pattern<Message> mKind(Pattern<? super Message.Kind> kind)
      Matches any Message with the given kind.
      Parameters:
      kind - the message kind to match
      Returns:
      the pattern
    • mKind

      public Pattern<Message> mKind(Message.Kind kind)
      Matches any Message with the given kind. Convenience abbreviation.
      Parameters:
      kind - the message kind to match
      Returns:
      the pattern
    • mText

      public Pattern<SimpleMessage<?>> mText(Pattern<? super String> text)
      Matches the text of the SimpleMessage.
      Parameters:
      text - to be matched by the message text data
      Returns:
      the pattern
    • mText

      public Pattern<SimpleMessage<?>> mText(String text)
      Tests the text of the SimpleMessage to be equal to the argument. Convenience abbreviation.
      Parameters:
      text - to be equal to the message text data
      Returns:
      the pattern
    • mTextStartsWith

      public Pattern<SimpleMessage<?>> mTextStartsWith(String pref)
      Tests the text of the SimpleMessage to start with the given argument. Convenience abbreviation.
      Parameters:
      pref - message text data has to start with
      Returns:
      the pattern
    • mLoc

      public Pattern<SimpleMessage<?>> mLoc(Pattern<? super Location<?>> loc)
      Tests the location of the SimpleMessage.
      Parameters:
      loc - has to match the messages location
      Returns:
      the pattern
    • mDocId

      public <D> Pattern<SimpleMessage<D>> mDocId(Pattern<? super D> docId)
      Tests the document id of the location of the SimpleMessage. Convenience abbreviation.
      Type Parameters:
      D - the type of the document id
      Parameters:
      docId - the pattern which must be mateched by the message location
      Returns:
      the pattern
    • mDocId

      public Pattern<SimpleMessage<String>> mDocId(String docId)
      Tests the doc id of the location of the SimpleMessage to be equal to the given argument. Convenience abbreviation.
      Parameters:
      docId - the document id which must be contained in the message location
      Returns:
      the pattern
    • mLine

      public Pattern<SimpleMessage<?>> mLine(Pattern<? super Integer> line)
      Tests the line number of the location of the SimpleMessage. Convenience abbreviation.
      Parameters:
      line - must be matched by the message location reference line
      Returns:
      the pattern
      See Also:
    • mLine

      public Pattern<SimpleMessage<?>> mLine(int line)
      Tests the line number of the location of the SimpleMessage to be equal to the given argument. Convenience abbreviation.
      Parameters:
      line - must be equal to message location reference line
      Returns:
      the pattern
      See Also: