Using @ResponseStatus allows setting the status of a Rest response in Spring. But how could this be used for different kinds of status that could come from the same request?
For example, there is a method in the controller that may return a 200 or a 404. How could I define these statuses just using @ResponseStatus in one method?