Interface PersistentMatcher<T>

Type Parameters:
T - type to compare
All Known Implementing Classes:
PersistentMatchers.EqualsMatcher
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface PersistentMatcher<T>
When using the persistence API you usually suffer from one major drawback: you are not able to define how the real parameters will get matched with the recorded ones. When using the core API you would use Matchers for this purpose. In this case we can't use regular matchers because the values we want to compare are both unknown. So we need another way to implement comparing logic. At this point the PersistentMatchers come to our aid.
A PersistentMatcher will compare two objects of the same type and determine whether they match.
To use them it will be necessary to create a ComboMatcher with PersistentMatchers.combo(Object, PersistentMatcher). These ComboMatchers can be used like a regular ParameterMatcher
See Also:
ComboMatcher, PersistentMatchers
  • Method Summary

    Modifier and Type Method Description
    boolean matches​(T first, T second)
    Compares two values in an arbitrary way with each other.
  • Method Details

    • matches

      boolean matches​(T first, T second)
      Compares two values in an arbitrary way with each other.
      Parameters:
      first - the first value (real value in the execution of the test)
      second - the second value (the persistent constant value)
      Returns:
      true if the objects should be considered as matching, false otherwise