1package org.apache.archiva.redback.rbac;
23/*4 * Copyright 2001-2006 The Apache Software Foundation.5 *6 * Licensed under the Apache License, Version 2.0 (the "License");7 * you may not use this file except in compliance with the License.8 * You may obtain a copy of the License at9 *10 * http://www.apache.org/licenses/LICENSE-2.011 *12 * Unless required by applicable law or agreed to in writing, software13 * distributed under the License is distributed on an "AS IS" BASIS,14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15 * See the License for the specific language governing permissions and16 * limitations under the License.17 */1819/**20 * AbstractRole useful for common logic that implementors can use. 21 *22 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>23 *24 */25publicabstractclassAbstractRole26implementsRole27 {
2829publicboolean hasChildRoles()
30 {
31return ( getChildRoleNames() != null ) && !getChildRoleNames().isEmpty();
32 }
3334/**35 * Method equals.36 *37 * @param other38 * @return boolean39 */40publicboolean equals( Object other )
41 {
42if ( this == other )
43 {
44returntrue;
45 }
4647if ( !( other instanceof AbstractRole ) )
48 {
49return false;
50 }
5152AbstractRole that = (AbstractRole) other;
53boolean result = true;
5455 result = result && ( getName() == null ? that.getName() == null : getName().equals( that.getName() ) );
5657return result;
58 }
59 }