001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.xml.multispaced;
023:
024: import java.util.List;
025: import java.util.ArrayList;
026:
027: /**
028: * @version <tt>$Revision: 57211 $</tt>
029: * @author <a href="mailto:alex@jboss.org">Alexey Loubyansky</a>
030: */
031: public class XMBeanMetaData {
032: private String description;
033: private String mbeanClass;
034: private List constructors = new ArrayList();
035: private List attributes = new ArrayList();
036: private List operations = new ArrayList();
037: private List notifications = new ArrayList();
038:
039: private Object persistenceManager;
040:
041: public String getDescription() {
042: return description;
043: }
044:
045: public void setDescription(String description) {
046: this .description = description;
047: }
048:
049: public String getMbeanClass() {
050: return mbeanClass;
051: }
052:
053: public void setMbeanClass(String mbeanClass) {
054: this .mbeanClass = mbeanClass;
055: }
056:
057: public List getConstructors() {
058: return constructors;
059: }
060:
061: public void addConstructor(XMBeanConstructorMetaData constructor) {
062: constructors.add(constructor);
063: }
064:
065: public List getAttributes() {
066: return attributes;
067: }
068:
069: public void addAttribute(XMBeanAttributeMetaData attribute) {
070: attributes.add(attribute);
071: }
072:
073: public List getOperations() {
074: return operations;
075: }
076:
077: public void addOperation(XMBeanOperationMetaData operation) {
078: operations.add(operation);
079: }
080:
081: public List getNotifications() {
082: return notifications;
083: }
084:
085: public void addNotification(XMBeanNotificationMetaData notification) {
086: notifications.add(notification);
087: }
088:
089: public Object getPersistenceManager() {
090: return persistenceManager;
091: }
092:
093: public void setPersistenceManager(Object persistenceManager) {
094: this .persistenceManager = persistenceManager;
095: }
096:
097: public String toString() {
098: return "[description=" + description + ", mbeanClass="
099: + mbeanClass + ", constructors=" + constructors
100: + ", attributes=" + attributes + ", operations="
101: + operations + ", notifications=" + notifications
102: + ", persistence-manager=" + persistenceManager + ']';
103: }
104:
105: public boolean equals(Object o) {
106: if (this == o)
107: return true;
108: if (!(o instanceof XMBeanMetaData))
109: return false;
110:
111: final XMBeanMetaData xmBeanMetaData = (XMBeanMetaData) o;
112:
113: if (attributes != null ? !attributes
114: .equals(xmBeanMetaData.attributes)
115: : xmBeanMetaData.attributes != null)
116: return false;
117: if (constructors != null ? !constructors
118: .equals(xmBeanMetaData.constructors)
119: : xmBeanMetaData.constructors != null)
120: return false;
121: if (description != null ? !description
122: .equals(xmBeanMetaData.description)
123: : xmBeanMetaData.description != null)
124: return false;
125: if (mbeanClass != null ? !mbeanClass
126: .equals(xmBeanMetaData.mbeanClass)
127: : xmBeanMetaData.mbeanClass != null)
128: return false;
129: if (notifications != null ? !notifications
130: .equals(xmBeanMetaData.notifications)
131: : xmBeanMetaData.notifications != null)
132: return false;
133: if (operations != null ? !operations
134: .equals(xmBeanMetaData.operations)
135: : xmBeanMetaData.operations != null)
136: return false;
137: if (persistenceManager != null ? !persistenceManager
138: .equals(xmBeanMetaData.persistenceManager)
139: : xmBeanMetaData.persistenceManager != null)
140: return false;
141:
142: return true;
143: }
144:
145: public int hashCode() {
146: int result;
147: result = (description != null ? description.hashCode() : 0);
148: result = 29 * result
149: + (mbeanClass != null ? mbeanClass.hashCode() : 0);
150: result = 29 * result
151: + (constructors != null ? constructors.hashCode() : 0);
152: result = 29 * result
153: + (attributes != null ? attributes.hashCode() : 0);
154: result = 29 * result
155: + (operations != null ? operations.hashCode() : 0);
156: result = 29
157: * result
158: + (notifications != null ? notifications.hashCode() : 0);
159: result = 29
160: * result
161: + (persistenceManager != null ? persistenceManager
162: .hashCode() : 0);
163: return result;
164: }
165: }
|