I have a spring boot application and want to use an Enum constant to specify the value as shown below, however, the compiler generates an error "Type mismatch: cannot convert from Constants to String" Here is the code block
@RequestMapping(method= RequestMethod.POST, value="/user")
public User createUser(@RequestBody User user,
@RequestHeader(value= Constants.HEADER_USER_AGENT) String userAgent
)
I know I can use public static String instead of Enum, but I wonder if it is possible to use Enum constants?