Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public enum Error {
  2. DATABASE(0, "A database error has occured."),
  3. DUPLICATE_USER(1, "This user already exists.");
  4.  
  5. private final int code;
  6. private final String description;
  7.  
  8. private Error(int code, String description) {
  9. this.code = code;
  10. this.description = description;
  11. }
  12.  
  13. public String getDescription() {
  14. return description;
  15. }
  16.  
  17. public int getCode() {
  18. return code;
  19. }
  20.  
  21. @Override
  22. public String toString() {
  23. return code + ": " + description;
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement