I want to create an annotation which is only available to a specific type of return values. For example this is my annotation. I also have an interface: An example class that implements my interface: So after these, I want to configure my annotation in a way that it won’t even compile if the return type is not implementing MyInterface.