Class StartsWith

java.lang.Object
org.mockito.internal.matchers.StartsWith
All Implemented Interfaces:
Serializable, ArgumentMatcher<String>

public class StartsWith extends Object implements ArgumentMatcher<String>, Serializable
See Also:
  • Constructor Details

    • StartsWith

      public StartsWith(String prefix)
  • Method Details

    • matches

      public boolean matches(String actual)
      Description copied from interface: ArgumentMatcher
      Informs if this matcher accepts the given argument.

      The method should never assert if the argument doesn't match. It should only return false.

      See the example in the top level javadoc for ArgumentMatcher

      Specified by:
      matches in interface ArgumentMatcher<String>
      Parameters:
      actual - the argument
      Returns:
      true if this matcher accepts the given argument.
    • toString

      public String toString()
      Overrides:
      toString in class Object