1
2
3
4 package com.lexicalscope.fluentreflection;
5
6 import org.hamcrest.Description;
7
8 final class MatcherHasNameEndingWith extends ReflectionMatcher<FluentMember> {
9 private final String suffix;
10
11 MatcherHasNameEndingWith(final String suffix) {
12 this.suffix = suffix;
13 }
14
15 @Override
16 public boolean matchesSafely(final FluentMember arg) {
17 return arg.name().endsWith(suffix);
18 }
19
20 @Override
21 public void describeTo(final Description description) {
22 description.appendText("callable ending with ").appendValue(suffix);
23 }
24 }