Пример #1
0
 public RoleTypeEnum fromId(Long id) {
   if (RoleTypeEnum.AUTHENTICATED.getId().equals(id)) {
     return RoleTypeEnum.AUTHENTICATED;
   }
   if (RoleTypeEnum.ADMIN.getId().equals(id)) {
     return RoleTypeEnum.ADMIN;
   }
   return null;
 }
Пример #2
0
 public static Role convertFromRoleType(Long id) {
   Role role = null;
   if (RoleTypeEnum.AUTHENTICATED.getId().equals(id)) {
     role = fromRoleType(RoleTypeEnum.AUTHENTICATED);
   }
   if (RoleTypeEnum.ADMIN.getId().equals(id)) {
     role = fromRoleType(RoleTypeEnum.ADMIN);
   }
   return role;
 }