001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link ClusterGroup}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       ClusterGroup
029     * @generated
030     */
031    public class ClusterGroupWrapper implements ClusterGroup,
032            ModelWrapper<ClusterGroup> {
033            public ClusterGroupWrapper(ClusterGroup clusterGroup) {
034                    _clusterGroup = clusterGroup;
035            }
036    
037            public Class<?> getModelClass() {
038                    return ClusterGroup.class;
039            }
040    
041            public String getModelClassName() {
042                    return ClusterGroup.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("clusterGroupId", getClusterGroupId());
049                    attributes.put("name", getName());
050                    attributes.put("clusterNodeIds", getClusterNodeIds());
051                    attributes.put("wholeCluster", getWholeCluster());
052    
053                    return attributes;
054            }
055    
056            public void setModelAttributes(Map<String, Object> attributes) {
057                    Long clusterGroupId = (Long)attributes.get("clusterGroupId");
058    
059                    if (clusterGroupId != null) {
060                            setClusterGroupId(clusterGroupId);
061                    }
062    
063                    String name = (String)attributes.get("name");
064    
065                    if (name != null) {
066                            setName(name);
067                    }
068    
069                    String clusterNodeIds = (String)attributes.get("clusterNodeIds");
070    
071                    if (clusterNodeIds != null) {
072                            setClusterNodeIds(clusterNodeIds);
073                    }
074    
075                    Boolean wholeCluster = (Boolean)attributes.get("wholeCluster");
076    
077                    if (wholeCluster != null) {
078                            setWholeCluster(wholeCluster);
079                    }
080            }
081    
082            /**
083            * Returns the primary key of this cluster group.
084            *
085            * @return the primary key of this cluster group
086            */
087            public long getPrimaryKey() {
088                    return _clusterGroup.getPrimaryKey();
089            }
090    
091            /**
092            * Sets the primary key of this cluster group.
093            *
094            * @param primaryKey the primary key of this cluster group
095            */
096            public void setPrimaryKey(long primaryKey) {
097                    _clusterGroup.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the cluster group ID of this cluster group.
102            *
103            * @return the cluster group ID of this cluster group
104            */
105            public long getClusterGroupId() {
106                    return _clusterGroup.getClusterGroupId();
107            }
108    
109            /**
110            * Sets the cluster group ID of this cluster group.
111            *
112            * @param clusterGroupId the cluster group ID of this cluster group
113            */
114            public void setClusterGroupId(long clusterGroupId) {
115                    _clusterGroup.setClusterGroupId(clusterGroupId);
116            }
117    
118            /**
119            * Returns the name of this cluster group.
120            *
121            * @return the name of this cluster group
122            */
123            public java.lang.String getName() {
124                    return _clusterGroup.getName();
125            }
126    
127            /**
128            * Sets the name of this cluster group.
129            *
130            * @param name the name of this cluster group
131            */
132            public void setName(java.lang.String name) {
133                    _clusterGroup.setName(name);
134            }
135    
136            /**
137            * Returns the cluster node IDs of this cluster group.
138            *
139            * @return the cluster node IDs of this cluster group
140            */
141            public java.lang.String getClusterNodeIds() {
142                    return _clusterGroup.getClusterNodeIds();
143            }
144    
145            /**
146            * Sets the cluster node IDs of this cluster group.
147            *
148            * @param clusterNodeIds the cluster node IDs of this cluster group
149            */
150            public void setClusterNodeIds(java.lang.String clusterNodeIds) {
151                    _clusterGroup.setClusterNodeIds(clusterNodeIds);
152            }
153    
154            /**
155            * Returns the whole cluster of this cluster group.
156            *
157            * @return the whole cluster of this cluster group
158            */
159            public boolean getWholeCluster() {
160                    return _clusterGroup.getWholeCluster();
161            }
162    
163            /**
164            * Returns <code>true</code> if this cluster group is whole cluster.
165            *
166            * @return <code>true</code> if this cluster group is whole cluster; <code>false</code> otherwise
167            */
168            public boolean isWholeCluster() {
169                    return _clusterGroup.isWholeCluster();
170            }
171    
172            /**
173            * Sets whether this cluster group is whole cluster.
174            *
175            * @param wholeCluster the whole cluster of this cluster group
176            */
177            public void setWholeCluster(boolean wholeCluster) {
178                    _clusterGroup.setWholeCluster(wholeCluster);
179            }
180    
181            public boolean isNew() {
182                    return _clusterGroup.isNew();
183            }
184    
185            public void setNew(boolean n) {
186                    _clusterGroup.setNew(n);
187            }
188    
189            public boolean isCachedModel() {
190                    return _clusterGroup.isCachedModel();
191            }
192    
193            public void setCachedModel(boolean cachedModel) {
194                    _clusterGroup.setCachedModel(cachedModel);
195            }
196    
197            public boolean isEscapedModel() {
198                    return _clusterGroup.isEscapedModel();
199            }
200    
201            public java.io.Serializable getPrimaryKeyObj() {
202                    return _clusterGroup.getPrimaryKeyObj();
203            }
204    
205            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
206                    _clusterGroup.setPrimaryKeyObj(primaryKeyObj);
207            }
208    
209            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
210                    return _clusterGroup.getExpandoBridge();
211            }
212    
213            public void setExpandoBridgeAttributes(
214                    com.liferay.portal.service.ServiceContext serviceContext) {
215                    _clusterGroup.setExpandoBridgeAttributes(serviceContext);
216            }
217    
218            @Override
219            public java.lang.Object clone() {
220                    return new ClusterGroupWrapper((ClusterGroup)_clusterGroup.clone());
221            }
222    
223            public int compareTo(com.liferay.portal.model.ClusterGroup clusterGroup) {
224                    return _clusterGroup.compareTo(clusterGroup);
225            }
226    
227            @Override
228            public int hashCode() {
229                    return _clusterGroup.hashCode();
230            }
231    
232            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ClusterGroup> toCacheModel() {
233                    return _clusterGroup.toCacheModel();
234            }
235    
236            public com.liferay.portal.model.ClusterGroup toEscapedModel() {
237                    return new ClusterGroupWrapper(_clusterGroup.toEscapedModel());
238            }
239    
240            public com.liferay.portal.model.ClusterGroup toUnescapedModel() {
241                    return new ClusterGroupWrapper(_clusterGroup.toUnescapedModel());
242            }
243    
244            @Override
245            public java.lang.String toString() {
246                    return _clusterGroup.toString();
247            }
248    
249            public java.lang.String toXmlString() {
250                    return _clusterGroup.toXmlString();
251            }
252    
253            public void persist()
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    _clusterGroup.persist();
256            }
257    
258            public java.lang.String[] getClusterNodeIdsArray() {
259                    return _clusterGroup.getClusterNodeIdsArray();
260            }
261    
262            @Override
263            public boolean equals(Object obj) {
264                    if (this == obj) {
265                            return true;
266                    }
267    
268                    if (!(obj instanceof ClusterGroupWrapper)) {
269                            return false;
270                    }
271    
272                    ClusterGroupWrapper clusterGroupWrapper = (ClusterGroupWrapper)obj;
273    
274                    if (Validator.equals(_clusterGroup, clusterGroupWrapper._clusterGroup)) {
275                            return true;
276                    }
277    
278                    return false;
279            }
280    
281            /**
282             * @deprecated Renamed to {@link #getWrappedModel}
283             */
284            public ClusterGroup getWrappedClusterGroup() {
285                    return _clusterGroup;
286            }
287    
288            public ClusterGroup getWrappedModel() {
289                    return _clusterGroup;
290            }
291    
292            public void resetOriginalValues() {
293                    _clusterGroup.resetOriginalValues();
294            }
295    
296            private ClusterGroup _clusterGroup;
297    }