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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.om.registry.base;
1819import org.apache.jetspeed.om.registry.ToolDescriptor;
2021/***22 * Bean-like implementation of the ToolDescriptor interface23 *24 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>25 * @version $Id: BaseToolDescriptor.java,v 1.2 2004/02/23 03:08:26 jford Exp $26 */27publicclassBaseToolDescriptor implements ToolDescriptor, java.io.Serializable
28 {
29private String name = null;
30private String scope = null;
31private String classname = null;
3233/***34 * Implements the equals operation so that 2 elements are equal if35 * all their member values are equal.36 */37publicboolean equals(Object object)
38 {
39if (object==null)
40 {
41return false;
42 }
4344BaseToolDescriptor obj = (BaseToolDescriptor)object;
4546if (name!=null)
47 {
48if (!name.equals(obj.getName()))
49 {
50return false;
51 }
52 }
53else54 {
55if (obj.getName()!=null)
56 {
57return false;
58 }
59 }
6061if (scope!=null)
62 {
63if(!scope.equals(obj.getScope()))
64 {
65return false;
66 }
67 }
68else69 {
70if (obj.getScope()!=null)
71 {
72return false;
73 }
74 }
7576if (classname!=null)
77 {
78if(!classname.equals(obj.getClassname()))
79 {
80return false;
81 }
82 }
83else84 {
85if (obj.getClassname()!=null)
86 {
87return false;
88 }
89 }
9091returntrue;
92 }
9394/*** @return the name of the tool */95public String getName()
96 {
97returnthis.name;
98 }
99100/*** Sets the name for this tool101 * @param title the new name of the tool102 */103publicvoid setName( String name )
104 {
105this.name = name;
106 }
107108/*** @return the scope of this tool */109public String getScope()
110 {
111returnthis.scope;
112 }
113114/*** Sets the scope of this tool.115 * The currently recognized scope are "request", "session", "persistent", "global"116 * @param scope the new scope of this tool117 */118publicvoid setScope( String scope )
119 {
120this.scope = scope;
121 }
122123/*** @return the clasname of this tool */124public String getClassname()
125 {
126returnthis.classname;
127 }
128129/*** Sets the classname of this tool130 * @param classname the new classname of this tool131 */132publicvoid setClassname( String classname )
133 {
134this.classname = classname;
135 }
136 }