View Javadoc

1   package com.lexicalscope.fluentreflection;
2   
3   import java.lang.reflect.Constructor;
4   
5   import org.hamcrest.Description;
6   
7   final class MatcherConstructorReflectingOn extends ReflectionMatcher<FluentConstructor<?>> {
8       private final Constructor<?> constructor;
9   
10      public MatcherConstructorReflectingOn(final Constructor<?> constructor) {
11          this.constructor = constructor;
12      }
13  
14      @Override
15      protected boolean matchesSafely(final FluentConstructor<?> item) {
16          return item.member().equals(constructor);
17      }
18  
19      @Override
20      public void describeTo(final Description description) {
21          description.appendText("reflecting on constructor ").appendValue(constructor);
22      }
23  }