Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1.  
  2. package ua.demirug.consoleserver.connection;
  3.  
  4. public enum ClientType {
  5.  
  6. BOARD(0),
  7. CLIENT(1);
  8.  
  9. private int id;
  10.  
  11. private ClientType(int id) {
  12. this.id = id;
  13. }
  14.  
  15. public int getID() {
  16. return this.id;
  17. }
  18.  
  19. public static ClientType getbyID(int id) {
  20. if (id >= 0 && id <= 1) {
  21. return ClientType.values()[id];
  22. } else {
  23. return null;
  24. }
  25. }
  26.  
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement