示例#1
0
文件: Role.java 项目: okAndrew/X-Pack
 public static Role findByNumber(int roleNumber) {
   for (Role role : roles) {
     if (role.getNumber() == roleNumber) {
       return role;
     }
   }
   return null;
 }
示例#2
0
文件: Role.java 项目: okAndrew/X-Pack
 public static Role findByName(String roleName) {
   for (Role role : roles) {
     if (role.getName().equalsIgnoreCase(roleName)) {
       return role;
     }
   }
   return null;
 }