Advertisement
Guest User

Untitled

a guest
Feb 16th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.17 KB | None | 0 0
  1. public YourEnum findByID(int id)
  2. {
  3.     for(YourEnum enumeration : YourEnum.values())
  4.     {
  5.         if(enumeration.getID() == id)  
  6.         {
  7.             return enumeration;
  8.         }
  9.     }  
  10.     return null;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement