View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  package org.seasar.tuigwaa.security.auth;
17  
18  /***
19   * @author someda
20   */
21  public class TgwRole extends TgwPrincipal {
22  
23  	private String description;
24  	private String dn;
25  	private String[] users;
26  	private boolean admin = false;	
27  	
28  	public TgwRole(String name){
29  		super(name);
30  	}		
31  	
32  	public TgwRole(){
33  		super();
34  	}
35  	
36  	public void setName(String name){
37  		this.name = name;
38  	}
39  
40  	public String getDescription() {
41  		return description;
42  	}
43  
44  	public void setDescription(String description) {
45  		this.description = description;
46  	}
47  
48  	public String getDn() {
49  		return dn;
50  	}
51  
52  	public void setDn(String dn) {
53  		this.dn = dn;
54  	}
55  
56  	public boolean isAdmin() {
57  		return admin;
58  	}
59  
60  	public void setAdmin(boolean admin) {
61  		this.admin = admin;
62  	}
63  
64  	public String[] getUsers() {
65  		return users;
66  	}
67  
68  	public void setUsers(String[] users) {
69  		this.users = users;
70  	}	
71  	
72  	public int hashCode(){
73  		return getName().hashCode();
74  	}
75  	
76  	public boolean equals(Object o){
77  		if(!(o instanceof TgwRole)) return false;
78  		TgwRole obj = (TgwRole) o;
79  		
80  		return obj.getName().equals(this.getName());				
81  	}
82  }