I have two public methods in same class with same return type, only different is the argument it takes. I want to have a pointcut apply on only one of it.
Here is the example of the class:
public class HahaService{ public MyObject sayHaha(User user){ //do something } public MyObject sayHaha(Long id, User user){ //do something } } Now I want to have a pointcut only apply on the 2nd sayHaha method which takes two arguments: a Long id and a User user.
I currently have a @Pointcut
@Pointcut("execution(public MyObject com.abc.service.HahaService.sayHaha(..))") private void hahaPointCut() { } This pointcut is applied on both sayHaha method.
Is there a way I can do it only on the 2nd one?