Android Open Source - Joetz-Android-V2 User Role

From Project

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.

Java Source Code

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 {

    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;

Java Source Code List