@Override public boolean equals(Object other) { if (this == other) { return true; } if (!super.equals(other)) { return false; } ClassFilter otherCf1 = ClassFilter.TRUE; ClassFilter otherCf2 = ClassFilter.TRUE; if (other instanceof ClassFilterAwareUnionMethodMatcher) { ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher) other; otherCf1 = cfa.cf1; otherCf2 = cfa.cf2; } return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2)); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!super.equals(other)) { return false; } ClassFilter otherCf1 = ClassFilter.TRUE; ClassFilter otherCf2 = ClassFilter.TRUE; if (other instanceof ClassFilterAwareUnionMethodMatcher) { ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher) other; otherCf1 = cfa.cf1; otherCf2 = cfa.cf2; } return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2)); } }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!super.equals(other)) { return false; } ClassFilter otherCf1 = ClassFilter.TRUE; ClassFilter otherCf2 = ClassFilter.TRUE; if (other instanceof ClassFilterAwareUnionMethodMatcher) { ClassFilterAwareUnionMethodMatcher cfa = (ClassFilterAwareUnionMethodMatcher) other; otherCf1 = cfa.cf1; otherCf2 = cfa.cf2; } return (this.cf1.equals(otherCf1) && this.cf2.equals(otherCf2)); }
public static MethodMatcher union(MethodMatcher a, MethodMatcher b) { return new UnionMethodMatcher(a, b); }
@Override public int hashCode() { // Allow for matching with regular UnionMethodMatcher by providing same hash... return super.hashCode(); } }
/** * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches. * @param mm1 the first MethodMatcher * @param mm2 the second MethodMatcher * @return a distinct MethodMatcher that matches all methods that either * of the given MethodMatchers matches */ public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2) { return new UnionMethodMatcher(mm1, mm2); }
@Override public boolean matches(Method method, Class<?> targetClass) { return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) || (matchesClass2(targetClass) && this.mm2.matches(method, targetClass)); }
/** * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches. * @param mm1 the first MethodMatcher * @param mm2 the second MethodMatcher * @return a distinct MethodMatcher that matches all methods that either * of the given MethodMatchers matches */ public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2) { return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ? new UnionIntroductionAwareMethodMatcher(mm1, mm2) : new UnionMethodMatcher(mm1, mm2)); }
@Override public boolean matches(Method method, Class<?> targetClass) { return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) || (matchesClass2(targetClass) && this.mm2.matches(method, targetClass)); }
@Override public boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions) { return (matchesClass1(targetClass) && MethodMatchers.matches(this.mm1, method, targetClass, hasIntroductions)) || (matchesClass2(targetClass) && MethodMatchers.matches(this.mm2, method, targetClass, hasIntroductions)); }
@Override public boolean matches(Method method, Class<?> targetClass) { return (matchesClass1(targetClass) && this.mm1.matches(method, targetClass)) || (matchesClass2(targetClass) && this.mm2.matches(method, targetClass)); }
/** * Match all methods that <i>either</i> (or both) of the given MethodMatchers matches. * @param mm1 the first MethodMatcher * @param mm2 the second MethodMatcher * @return a distinct MethodMatcher that matches all methods that either * of the given MethodMatchers matches */ public static MethodMatcher union(MethodMatcher mm1, MethodMatcher mm2) { return (mm1 instanceof IntroductionAwareMethodMatcher || mm2 instanceof IntroductionAwareMethodMatcher ? new UnionIntroductionAwareMethodMatcher(mm1, mm2) : new UnionMethodMatcher(mm1, mm2)); }
@Override public int hashCode() { // Allow for matching with regular UnionMethodMatcher by providing same hash... return super.hashCode(); } }