Class Patterns

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

public class Patterns extends Object
Patterns for messages. Especially useful with unit tests.
  • Method Details

    • mKind

      public Pattern<Message> mKind(Pattern<? super Message.Kind> kind)
      Matches the kind of the Message.
    • mKind

      public Pattern<Message> mKind(Message.Kind kind)
      Matches any Message with the given kind. Convenience abbreviation.
    • mText

      public Pattern<SimpleMessage> mText(Pattern<? super String> text)
      Matches the text of the SimpleMessage.
    • mText

      public Pattern<SimpleMessage> mText(String text)
      Tests the text of the SimpleMessage to be equal to the argument. Convenience abbreviation.
    • mTextStartsWith

      public Pattern<SimpleMessage> mTextStartsWith(String pref)
      Tests the text of the SimpleMessage to start with the given argument. Convenience abbreviation.
    • mLoc

      public Pattern<SimpleMessage<?>> mLoc(Pattern<? super Location<?>> loc)
      Matches the location of the SimpleMessage.
    • mDocId

      public <D> Pattern<SimpleMessage<D>> mDocId(Pattern<? super D> docId)
      Matches the doc id of the location of the SimpleMessage. Convenience abbreviation.
    • mDocId

      public Pattern<SimpleMessage> mDocId(String docId)
      Tests the doc id of the location of the SimpleMessage to be equal to the given argument. Convenience abbreviation.
    • mLine

      public Pattern<SimpleMessage> mLine(Pattern<? super Integer> line)
      Tests the dline number of the location of the SimpleMessage. Convenience abbreviation.
    • 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.