Open GoogleCodeExporter opened 9 years ago
public class ClassAnnotatedWithMatcher
extends AbstractMatcher<Class>
{
public static Matcher<Class> classAnnotatedWith( Class< ? extends Annotation>
annotation )
{
return new ClassAnnotatedWithMatcher(annotation);
}
private Class< ? extends Annotation> annotation;
public ClassAnnotatedWithMatcher(Class< ? extends Annotation> annotation)
{
Objects.nonNull(annotation, "annotation");
this.annotation = annotation;
}
@Override
public boolean matches(Class clazz)
{
return clazz.isAnnotationPresent(annotation);
}
@Override
public String toString() {
return "classAnnotatedWith(" + annotation.getSimpleName() + ")";
}
}
Original comment by AaronJWh...@gmail.com
on 19 Nov 2007 at 3:48
Matchers.annotatedWith() supports classes.
Original comment by limpbizkit
on 5 Jun 2008 at 7:54
Original issue reported on code.google.com by
AaronJWh...@gmail.com
on 14 Nov 2007 at 2:20