/** * Get a new sub-list of methods containing all the methods from this method * list that declare the specified return type. * * @param returnType method return type. * @return new filtered method sub-list. */ public MethodList hasReturnType(final Class<?> returnType) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getReturnType() == returnType; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that are not public. * * @return new filtered method sub-list. */ public MethodList isNotPublic() { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return !Modifier.isPublic(m.getMethod().getModifiers()); } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that are not public. * * @return new filtered method sub-list. */ public MethodList isNotPublic() { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return !Modifier.isPublic(m.getMethod().getModifiers()); } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that have the specific number of parameters. * * @param paramCount number of method parameters. * @return new filtered method sub-list. */ public MethodList hasNumParams(final int paramCount) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getParameterTypes().length == paramCount; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that have the specific number of parameters. * * @param paramCount number of method parameters. * @return new filtered method sub-list. */ public MethodList hasNumParams(final int paramCount) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getParameterTypes().length == paramCount; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that declare the specified return type. * * @param returnType method return type. * @return new filtered method sub-list. */ public MethodList hasReturnType(final Class<?> returnType) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getReturnType() == returnType; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a specified method name prefix. * * @param prefix method name prefix. * @return new filtered method sub-list. */ public MethodList nameStartsWith(final String prefix) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getName().startsWith(prefix); } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a specified method name prefix. * * @param prefix method name prefix. * @return new filtered method sub-list. */ public MethodList nameStartsWith(final String prefix) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getName().startsWith(prefix); } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a specified method-level annotation declared. * * @param <T> annotation type. * * @param annotation annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getAnnotation(annotation) != null; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list without a specified method-level annotation declared. * * @param <T> annotation type. * * @param annotation annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withoutAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getAnnotation(annotation) == null; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a specified method-level annotation declared. * * @param <T> annotation type. * * @param annotation annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getAnnotation(annotation) != null; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list without a specified method-level annotation declared. * * @param <T> annotation type. * * @param annotation annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withoutAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getAnnotation(annotation) == null; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list without any method-level annotation declared that would itself be * annotated with a specified meta-annotation. * * @param <T> meta-annotation type. * * @param annotation meta-annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withoutMetaAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a method-level annotation declared that is itself annotated with * a specified meta-annotation. * * @param <T> meta-annotation type. * * @param annotation meta-annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withMetaAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list without any method-level annotation declared that would itself be * annotated with a specified meta-annotation. * * @param <T> meta-annotation type. * * @param annotation meta-annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withoutMetaAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return false; } } return true; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a method-level annotation declared that is itself annotated with * a specified meta-annotation. * * @param <T> meta-annotation type. * * @param annotation meta-annotation class. * @return new filtered method sub-list. */ public <T extends Annotation> MethodList withMetaAnnotation(final Class<T> annotation) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { for (Annotation a : m.getAnnotations()) { if (a.annotationType().getAnnotation(annotation) != null) { return true; } } return false; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that declare the specified return type. * * @param returnType method return type. * @return new filtered method sub-list. */ public MethodList hasReturnType(final Class<?> returnType) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getReturnType() == returnType; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that are not public. * * @return new filtered method sub-list. */ public MethodList isNotPublic() { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return !Modifier.isPublic(m.getMethod().getModifiers()); } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list that have the specific number of parameters. * * @param paramCount number of method parameters. * @return new filtered method sub-list. */ public MethodList hasNumParams(final int paramCount) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getParameterTypes().length == paramCount; } }); }
/** * Get a new sub-list of methods containing all the methods from this method * list with a specified method name prefix. * * @param prefix method name prefix. * @return new filtered method sub-list. */ public MethodList nameStartsWith(final String prefix) { return filter(new Filter() { @Override public boolean keep(AnnotatedMethod m) { return m.getMethod().getName().startsWith(prefix); } }); }