View Javadoc

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