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            @Override
038            public Class<?> getModelClass() {
039                    return ClusterGroup.class;
040            }
041    
042            @Override
043            public String getModelClassName() {
044                    return ClusterGroup.class.getName();
045            }
046    
047            @Override
048            public Map<String, Object> getModelAttributes() {
049                    Map<String, Object> attributes = new HashMap<String, Object>();
050    
051                    attributes.put("clusterGroupId", getClusterGroupId());
052                    attributes.put("name", getName());
053                    attributes.put("clusterNodeIds", getClusterNodeIds());
054                    attributes.put("wholeCluster", getWholeCluster());
055    
056                    return attributes;
057            }
058    
059            @Override
060            public void setModelAttributes(Map<String, Object> attributes) {
061                    Long clusterGroupId = (Long)attributes.get("clusterGroupId");
062    
063                    if (clusterGroupId != null) {
064                            setClusterGroupId(clusterGroupId);
065                    }
066    
067                    String name = (String)attributes.get("name");
068    
069                    if (name != null) {
070                            setName(name);
071                    }
072    
073                    String clusterNodeIds = (String)attributes.get("clusterNodeIds");
074    
075                    if (clusterNodeIds != null) {
076                            setClusterNodeIds(clusterNodeIds);
077                    }
078    
079                    Boolean wholeCluster = (Boolean)attributes.get("wholeCluster");
080    
081                    if (wholeCluster != null) {
082                            setWholeCluster(wholeCluster);
083                    }
084            }
085    
086            /**
087            * Returns the primary key of this cluster group.
088            *
089            * @return the primary key of this cluster group
090            */
091            @Override
092            public long getPrimaryKey() {
093                    return _clusterGroup.getPrimaryKey();
094            }
095    
096            /**
097            * Sets the primary key of this cluster group.
098            *
099            * @param primaryKey the primary key of this cluster group
100            */
101            @Override
102            public void setPrimaryKey(long primaryKey) {
103                    _clusterGroup.setPrimaryKey(primaryKey);
104            }
105    
106            /**
107            * Returns the cluster group ID of this cluster group.
108            *
109            * @return the cluster group ID of this cluster group
110            */
111            @Override
112            public long getClusterGroupId() {
113                    return _clusterGroup.getClusterGroupId();
114            }
115    
116            /**
117            * Sets the cluster group ID of this cluster group.
118            *
119            * @param clusterGroupId the cluster group ID of this cluster group
120            */
121            @Override
122            public void setClusterGroupId(long clusterGroupId) {
123                    _clusterGroup.setClusterGroupId(clusterGroupId);
124            }
125    
126            /**
127            * Returns the name of this cluster group.
128            *
129            * @return the name of this cluster group
130            */
131            @Override
132            public java.lang.String getName() {
133                    return _clusterGroup.getName();
134            }
135    
136            /**
137            * Sets the name of this cluster group.
138            *
139            * @param name the name of this cluster group
140            */
141            @Override
142            public void setName(java.lang.String name) {
143                    _clusterGroup.setName(name);
144            }
145    
146            /**
147            * Returns the cluster node IDs of this cluster group.
148            *
149            * @return the cluster node IDs of this cluster group
150            */
151            @Override
152            public java.lang.String getClusterNodeIds() {
153                    return _clusterGroup.getClusterNodeIds();
154            }
155    
156            /**
157            * Sets the cluster node IDs of this cluster group.
158            *
159            * @param clusterNodeIds the cluster node IDs of this cluster group
160            */
161            @Override
162            public void setClusterNodeIds(java.lang.String clusterNodeIds) {
163                    _clusterGroup.setClusterNodeIds(clusterNodeIds);
164            }
165    
166            /**
167            * Returns the whole cluster of this cluster group.
168            *
169            * @return the whole cluster of this cluster group
170            */
171            @Override
172            public boolean getWholeCluster() {
173                    return _clusterGroup.getWholeCluster();
174            }
175    
176            /**
177            * Returns <code>true</code> if this cluster group is whole cluster.
178            *
179            * @return <code>true</code> if this cluster group is whole cluster; <code>false</code> otherwise
180            */
181            @Override
182            public boolean isWholeCluster() {
183                    return _clusterGroup.isWholeCluster();
184            }
185    
186            /**
187            * Sets whether this cluster group is whole cluster.
188            *
189            * @param wholeCluster the whole cluster of this cluster group
190            */
191            @Override
192            public void setWholeCluster(boolean wholeCluster) {
193                    _clusterGroup.setWholeCluster(wholeCluster);
194            }
195    
196            @Override
197            public boolean isNew() {
198                    return _clusterGroup.isNew();
199            }
200    
201            @Override
202            public void setNew(boolean n) {
203                    _clusterGroup.setNew(n);
204            }
205    
206            @Override
207            public boolean isCachedModel() {
208                    return _clusterGroup.isCachedModel();
209            }
210    
211            @Override
212            public void setCachedModel(boolean cachedModel) {
213                    _clusterGroup.setCachedModel(cachedModel);
214            }
215    
216            @Override
217            public boolean isEscapedModel() {
218                    return _clusterGroup.isEscapedModel();
219            }
220    
221            @Override
222            public java.io.Serializable getPrimaryKeyObj() {
223                    return _clusterGroup.getPrimaryKeyObj();
224            }
225    
226            @Override
227            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
228                    _clusterGroup.setPrimaryKeyObj(primaryKeyObj);
229            }
230    
231            @Override
232            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
233                    return _clusterGroup.getExpandoBridge();
234            }
235    
236            @Override
237            public void setExpandoBridgeAttributes(
238                    com.liferay.portal.model.BaseModel<?> baseModel) {
239                    _clusterGroup.setExpandoBridgeAttributes(baseModel);
240            }
241    
242            @Override
243            public void setExpandoBridgeAttributes(
244                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
245                    _clusterGroup.setExpandoBridgeAttributes(expandoBridge);
246            }
247    
248            @Override
249            public void setExpandoBridgeAttributes(
250                    com.liferay.portal.service.ServiceContext serviceContext) {
251                    _clusterGroup.setExpandoBridgeAttributes(serviceContext);
252            }
253    
254            @Override
255            public java.lang.Object clone() {
256                    return new ClusterGroupWrapper((ClusterGroup)_clusterGroup.clone());
257            }
258    
259            @Override
260            public int compareTo(com.liferay.portal.model.ClusterGroup clusterGroup) {
261                    return _clusterGroup.compareTo(clusterGroup);
262            }
263    
264            @Override
265            public int hashCode() {
266                    return _clusterGroup.hashCode();
267            }
268    
269            @Override
270            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ClusterGroup> toCacheModel() {
271                    return _clusterGroup.toCacheModel();
272            }
273    
274            @Override
275            public com.liferay.portal.model.ClusterGroup toEscapedModel() {
276                    return new ClusterGroupWrapper(_clusterGroup.toEscapedModel());
277            }
278    
279            @Override
280            public com.liferay.portal.model.ClusterGroup toUnescapedModel() {
281                    return new ClusterGroupWrapper(_clusterGroup.toUnescapedModel());
282            }
283    
284            @Override
285            public java.lang.String toString() {
286                    return _clusterGroup.toString();
287            }
288    
289            @Override
290            public java.lang.String toXmlString() {
291                    return _clusterGroup.toXmlString();
292            }
293    
294            @Override
295            public void persist()
296                    throws com.liferay.portal.kernel.exception.SystemException {
297                    _clusterGroup.persist();
298            }
299    
300            @Override
301            public java.lang.String[] getClusterNodeIdsArray() {
302                    return _clusterGroup.getClusterNodeIdsArray();
303            }
304    
305            @Override
306            public boolean equals(Object obj) {
307                    if (this == obj) {
308                            return true;
309                    }
310    
311                    if (!(obj instanceof ClusterGroupWrapper)) {
312                            return false;
313                    }
314    
315                    ClusterGroupWrapper clusterGroupWrapper = (ClusterGroupWrapper)obj;
316    
317                    if (Validator.equals(_clusterGroup, clusterGroupWrapper._clusterGroup)) {
318                            return true;
319                    }
320    
321                    return false;
322            }
323    
324            /**
325             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
326             */
327            public ClusterGroup getWrappedClusterGroup() {
328                    return _clusterGroup;
329            }
330    
331            @Override
332            public ClusterGroup getWrappedModel() {
333                    return _clusterGroup;
334            }
335    
336            @Override
337            public void resetOriginalValues() {
338                    _clusterGroup.resetOriginalValues();
339            }
340    
341            private ClusterGroup _clusterGroup;
342    }