Class MatcherToString


  • final class MatcherToString
    extends java.lang.Object
    Provides better toString() text for matcher that don't have toString() method declared.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private MatcherToString()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static java.lang.String toString​(ArgumentMatcher<?> matcher)
      Attempts to provide more descriptive toString() for given matcher.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatcherToString

        private MatcherToString()
    • Method Detail

      • toString

        static java.lang.String toString​(ArgumentMatcher<?> matcher)
        Attempts to provide more descriptive toString() for given matcher. Searches matcher class hierarchy for toString() method. If it is found it will be used. If no toString() is defined for the matcher hierarchy, uses decamelized class name instead of default Object.toString(). This way we can promote meaningful names for custom matchers.
        Parameters:
        matcher -
        Returns: