1/*
2 * Copyright (c) 2007 Mockito contributors
3 * This program is made available under the terms of the MIT License.
4 */
5
6package org.mockito.internal.matchers;
7
8import java.io.Serializable;
9
10import org.mockito.ArgumentMatcher;
11
12public class EndsWith implements ArgumentMatcher<String>, Serializable {
13
14    private final String suffix;
15
16    public EndsWith(String suffix) {
17        this.suffix = suffix;
18    }
19
20    public boolean matches(String actual) {
21        return actual != null && actual.endsWith(suffix);
22    }
23
24    public String toString() {
25        return "endsWith(\"" + suffix + "\")";
26    }
27}
28