Created
July 23, 2016 23:04
-
-
Save achyutdev/22d41ac2c50718bb3a42a990840b0659 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public enum Error { | |
DATABASE(0, "A database error has occured."), | |
DUPLICATE_USER(1, "This user already exists."); | |
private final int code; | |
private final String description; | |
private Error(int code, String description) { | |
this.code = code; | |
this.description = description; | |
} | |
public String getDescription() { | |
return description; | |
} | |
public int getCode() { | |
return code; | |
} | |
@Override | |
public String toString() { | |
return code + ": " + description; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment