I want to deprecate some, but not all possible enumeration values.
Yes, put a @Deprecated annotation on them. For example:
enum Status {
OK,
ERROR,
@Deprecated
PROBLEM
}
You can also add a JavaDoc @deprecated
tag to document it:
enum Status {
OK,
ERROR,
/**
* @deprecated Use ERROR instead.
*/
@Deprecated
PROBLEM
}