1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.jmx.model;
16  
17  import com.liferay.portal.kernel.util.HashCode;
18  import com.liferay.portal.kernel.util.HashCodeFactoryUtil;
19  import com.liferay.portal.kernel.util.Validator;
20  
21  import java.io.Serializable;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="Domain.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Shuyang Zhou
29   */
30  public class Domain implements Serializable {
31  
32      public Domain(String domainName) {
33          _domainName = domainName;
34      }
35  
36      public Domain(String domainName, List<MBean> mBeans) {
37          _domainName = domainName;
38          _mBeans = mBeans;
39          _loaded = true;
40      }
41  
42      public boolean equals(Object obj) {
43          if (this == obj) {
44              return true;
45          }
46  
47          if (!(obj instanceof Domain)) {
48              return false;
49          }
50  
51          Domain domain = (Domain)obj;
52  
53          if (Validator.equals(_domainName, domain._domainName)) {
54  
55              return true;
56          }
57  
58          return false;
59      }
60  
61      public String getDomainName() {
62          return _domainName;
63      }
64  
65      public List<MBean> getMBeans() {
66          return _mBeans;
67      }
68  
69      public int hashCode() {
70          HashCode hashCode = HashCodeFactoryUtil.getHashCode();
71  
72          hashCode.append(_domainName);
73  
74          return hashCode.toHashCode();
75      }
76  
77      public boolean isLoaded() {
78          return _loaded;
79      }
80  
81      private String _domainName;
82      private boolean _loaded;
83      private List<MBean> _mBeans;
84  
85  }