Back to project page Joetz-Android-V2.
The source code is released under:
GNU General Public License
If you think the Android project Joetz-Android-V2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.jens.myapplication.domain; /*from w w w .j a v a 2 s . c o m*/ /** * The role a user can have */ public enum UserRole { USER(0), MONITOR(1), ADMINISTRATOR(2); private int value; private UserRole(int value){ this.value = value; } public int value(){ return value; } /** * Find a UserRole based on the value of the role * @param value value of the role (flags?) * @return UserRole if found, if value was invalid, returns null */ public UserRole findRole(int value){ UserRole[] roles = values(); for(UserRole role : roles){ if(role.value() == value){ return role; } } return null; } }