View Javadoc

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