KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > repo > security > permissions > impl > hibernate > PermissionReferenceImpl


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.repo.security.permissions.impl.hibernate;
18
19
20 /**
21  * The persisted class for permission references.
22  *
23  * @author andyh
24  */

25 public class PermissionReferenceImpl implements PermissionReference
26 {
27     /**
28      * Comment for <code>serialVersionUID</code>
29      */

30     private static final long serialVersionUID = -6352566900815035461L;
31
32     private String JavaDoc typeUri;
33     
34     private String JavaDoc typeName;
35     
36     private String JavaDoc name;
37
38     public PermissionReferenceImpl()
39     {
40         super();
41     }
42     
43     public String JavaDoc getTypeUri()
44     {
45         return typeUri;
46     }
47
48     public void setTypeUri(String JavaDoc typeUri)
49     {
50        this.typeUri = typeUri;
51     }
52     
53     public String JavaDoc getTypeName()
54     {
55         return typeName;
56     }
57
58     public void setTypeName(String JavaDoc typeName)
59     {
60        this.typeName = typeName;
61     }
62
63     public String JavaDoc getName()
64     {
65         return name;
66     }
67
68     public void setName(String JavaDoc name)
69     {
70         this.name = name;
71     }
72
73     // Hibernate pattern
74

75     @Override JavaDoc
76     public boolean equals(Object JavaDoc o)
77     {
78         if(this == o)
79         {
80             return true;
81         }
82         if(!(o instanceof PermissionReference))
83         {
84             return false;
85         }
86         PermissionReference other = (PermissionReference)o;
87         return this.getTypeUri().equals(other.getTypeUri()) && this.getTypeName().equals(other.getTypeName()) && this.getName().equals(other.getName());
88     }
89
90     @Override JavaDoc
91     public int hashCode()
92     {
93         return ((typeUri.hashCode() * 37) + typeName.hashCode() ) * 37 + name.hashCode();
94     }
95     
96     
97
98 }
99
Popular Tags