Interface ArgumentMatcher<M extends ArgumentMatcher<M>>

All Known Implementing Classes:
AlwaysTrueMatcher, CaptureMatcher, ClassMatcher, EqualityMatcher, HamcrestAdapter, InequalityMatcher, LenientEqualityMatcher, NonNullityMatcher, NullityMatcher, NumericEqualityMatcher, PatternMatcher, ReflectiveMatcher, SamenessMatcher, StringContainmentMatcher, StringPrefixMatcher, StringSuffixMatcher

public interface ArgumentMatcher<M extends ArgumentMatcher<M>>
An argument matcher for the recording/verification of expectations.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    matches(Object argValue)
    Evaluates the matcher for the given argument.
    boolean
    same(M other)
    Indicates whether this matcher instance is functionally the same as another one of the same type.
    void
    Writes a phrase to be part of an error message describing an argument mismatch.
  • Method Details

    • same

      boolean same(@NonNull M other)
      Indicates whether this matcher instance is functionally the same as another one of the same type.
    • matches

      boolean matches(@Nullable Object argValue)
      Evaluates the matcher for the given argument.
    • writeMismatchPhrase

      void writeMismatchPhrase(@NonNull ArgumentMismatch argumentMismatch)
      Writes a phrase to be part of an error message describing an argument mismatch.