Last active
August 29, 2015 14:19
-
-
Save fedotxxl/2ada07f9ad48671c0eb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.fasterxml.jackson.annotation.JsonCreator; | |
import com.fasterxml.jackson.annotation.JsonValue; | |
public enum ExceptionStatus { | |
OPENED("open"), FIXED("fixed"), IGNORE("ignore"), LATER("later"); | |
private String id; | |
ExceptionStatus(String id) { | |
this.id = id; | |
} | |
@JsonValue | |
public String getId() { | |
return id; | |
} | |
@JsonCreator | |
static ExceptionStatus myValueOf(String id) { | |
for (ExceptionStatus status : values()) { | |
if (status.id.equals(id)) return status; | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment