1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| package org.easymock.internal.matchers; |
6 |
| |
7 |
| import org.easymock.IArgumentMatcher; |
8 |
| |
9 |
| public class StartsWith implements IArgumentMatcher { |
10 |
| |
11 |
| private final String prefix; |
12 |
| |
13 |
3
| public StartsWith(String prefix) {
|
14 |
3
| this.prefix = prefix;
|
15 |
| } |
16 |
| |
17 |
4
| public boolean matches(Object actual) {
|
18 |
4
| return (actual instanceof String)
|
19 |
| && ((String) actual).startsWith(prefix); |
20 |
| } |
21 |
| |
22 |
1
| public void appendTo(StringBuffer buffer) {
|
23 |
1
| buffer.append("startsWith(\"" + prefix + "\")");
|
24 |
| } |
25 |
| } |