/** * Set the expected super class of the return type for every matching method. * * @param type - the return type, or a super class of it. * @return This builder, for chaining. */ public Builder returnDerivedOf(Class<?> type) { member.returnMatcher = FuzzyMatchers.matchDerived(type); return this; }
/** * Add a new required parameter whose type must be a derived class of the given class. * * <p>If the method parameter has the type Integer, then the class Number here will match it. * * @param type - a type or more derived type of the matching parameter. * @param index - the expected position in the parameter list. * @return This builder, for chaining. */ public Builder parameterDerivedOf(Class<?> type, int index) { member.paramMatchers.add(new ParameterClassMatcher(FuzzyMatchers.matchDerived(type), index)); return this; }