1
10package org.jstk.uam;
11
12import java.security.Principal;
13
14public class JSTKRolePrincipal implements Principal {
15 String roleName;
16 String roleDesc;
17
18 public JSTKRolePrincipal(String roleName, String roleDesc){
19 this.roleName = roleName;
20 this.roleDesc = roleDesc;
21 }
22 public boolean equals(Object another){
23 if (another instanceof JSTKRolePrincipal){
24 return roleName.equals(((JSTKRolePrincipal)another).getName());
25 }
26 return false;
27 }
28 public String getName(){
29 return roleName;
30 }
31 public int hashCode(){
32 return roleName.hashCode();
33 }
34 public String toString(){
35 return "[" + this.getClass().getName() + "]" + "role: " + roleName + ", desc: " + roleDesc;
36 }
37}