KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > om > registry > base > BaseCategory


1 /*
2  * Copyright 2000-2001,2004 The Apache Software Foundation.
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, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.jetspeed.om.registry.base;
18
19 import org.apache.jetspeed.om.registry.Category;
20
21 /**
22  * Bean like implementation of the Category interface suitable for
23  * Castor serialization.
24  *
25  * @see org.apache.jetspeed.om.registry.Security
26  * @author <a HREF="mailto:taylor@apache.org">David Sean Taylor</a>
27  * @version $Id: BaseCategory.java,v 1.4 2004/02/23 03:08:26 jford Exp $
28  */

29 public class BaseCategory implements Category, java.io.Serializable JavaDoc
30 {
31     private String JavaDoc name;
32     private String JavaDoc group = "Jetspeed";
33
34     /**
35      * Implements the equals operation so that 2 elements are equal if
36      * all their member values are equal.
37      */

38     public boolean equals(Object JavaDoc object)
39     {
40         if (object==null)
41         {
42             return false;
43         }
44
45         BaseCategory obj = (BaseCategory)object;
46
47         if (name!=null)
48         {
49             if (!name.equals(obj.getName()))
50             {
51                 return false;
52             }
53         }
54         else
55         {
56             if (obj.getName()!=null)
57             {
58                 return false;
59             }
60         }
61
62         if (group!=null)
63         {
64             if(!group.equals(obj.getGroup()))
65             {
66                 return false;
67             }
68         }
69         else
70         {
71             if (obj.getGroup()!=null)
72             {
73                 return false;
74             }
75         }
76
77         return true;
78     }
79
80     /** @return the string Name */
81     public String JavaDoc getName()
82     {
83         return name;
84     }
85
86     /** Sets the string Name
87      *
88      * @param value the new Name value
89      */

90     public void setName(String JavaDoc name)
91     {
92         this.name = name;
93     }
94
95     /** @return the string Group */
96     public String JavaDoc getGroup()
97     {
98         return group;
99     }
100
101     /** Sets the string Group
102      *
103      * @param value the new Group value
104      */

105     public void setGroup(String JavaDoc group)
106     {
107         this.group = group;
108     }
109
110 }
Popular Tags