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