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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    import com.liferay.portal.kernel.util.Validator;
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(
108                    com.liferay.portal.kernel.model.ClusterGroup clusterGroup) {
109                    return _clusterGroup.compareTo(clusterGroup);
110            }
111    
112            /**
113            * Returns the cluster group ID of this cluster group.
114            *
115            * @return the cluster group ID of this cluster group
116            */
117            @Override
118            public long getClusterGroupId() {
119                    return _clusterGroup.getClusterGroupId();
120            }
121    
122            /**
123            * Returns the cluster node IDs of this cluster group.
124            *
125            * @return the cluster node IDs of this cluster group
126            */
127            @Override
128            public java.lang.String getClusterNodeIds() {
129                    return _clusterGroup.getClusterNodeIds();
130            }
131    
132            @Override
133            public java.lang.String[] getClusterNodeIdsArray() {
134                    return _clusterGroup.getClusterNodeIdsArray();
135            }
136    
137            @Override
138            public ExpandoBridge getExpandoBridge() {
139                    return _clusterGroup.getExpandoBridge();
140            }
141    
142            /**
143            * Returns the mvcc version of this cluster group.
144            *
145            * @return the mvcc version of this cluster group
146            */
147            @Override
148            public long getMvccVersion() {
149                    return _clusterGroup.getMvccVersion();
150            }
151    
152            /**
153            * Returns the name of this cluster group.
154            *
155            * @return the name of this cluster group
156            */
157            @Override
158            public java.lang.String getName() {
159                    return _clusterGroup.getName();
160            }
161    
162            /**
163            * Returns the primary key of this cluster group.
164            *
165            * @return the primary key of this cluster group
166            */
167            @Override
168            public long getPrimaryKey() {
169                    return _clusterGroup.getPrimaryKey();
170            }
171    
172            @Override
173            public Serializable getPrimaryKeyObj() {
174                    return _clusterGroup.getPrimaryKeyObj();
175            }
176    
177            /**
178            * Returns the whole cluster of this cluster group.
179            *
180            * @return the whole cluster of this cluster group
181            */
182            @Override
183            public boolean getWholeCluster() {
184                    return _clusterGroup.getWholeCluster();
185            }
186    
187            @Override
188            public int hashCode() {
189                    return _clusterGroup.hashCode();
190            }
191    
192            @Override
193            public boolean isCachedModel() {
194                    return _clusterGroup.isCachedModel();
195            }
196    
197            @Override
198            public boolean isEscapedModel() {
199                    return _clusterGroup.isEscapedModel();
200            }
201    
202            @Override
203            public boolean isNew() {
204                    return _clusterGroup.isNew();
205            }
206    
207            /**
208            * Returns <code>true</code> if this cluster group is whole cluster.
209            *
210            * @return <code>true</code> if this cluster group is whole cluster; <code>false</code> otherwise
211            */
212            @Override
213            public boolean isWholeCluster() {
214                    return _clusterGroup.isWholeCluster();
215            }
216    
217            @Override
218            public void persist() {
219                    _clusterGroup.persist();
220            }
221    
222            @Override
223            public void setCachedModel(boolean cachedModel) {
224                    _clusterGroup.setCachedModel(cachedModel);
225            }
226    
227            /**
228            * Sets the cluster group ID of this cluster group.
229            *
230            * @param clusterGroupId the cluster group ID of this cluster group
231            */
232            @Override
233            public void setClusterGroupId(long clusterGroupId) {
234                    _clusterGroup.setClusterGroupId(clusterGroupId);
235            }
236    
237            /**
238            * Sets the cluster node IDs of this cluster group.
239            *
240            * @param clusterNodeIds the cluster node IDs of this cluster group
241            */
242            @Override
243            public void setClusterNodeIds(java.lang.String clusterNodeIds) {
244                    _clusterGroup.setClusterNodeIds(clusterNodeIds);
245            }
246    
247            @Override
248            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
249                    _clusterGroup.setExpandoBridgeAttributes(baseModel);
250            }
251    
252            @Override
253            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
254                    _clusterGroup.setExpandoBridgeAttributes(expandoBridge);
255            }
256    
257            @Override
258            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
259                    _clusterGroup.setExpandoBridgeAttributes(serviceContext);
260            }
261    
262            /**
263            * Sets the mvcc version of this cluster group.
264            *
265            * @param mvccVersion the mvcc version of this cluster group
266            */
267            @Override
268            public void setMvccVersion(long mvccVersion) {
269                    _clusterGroup.setMvccVersion(mvccVersion);
270            }
271    
272            /**
273            * Sets the name of this cluster group.
274            *
275            * @param name the name of this cluster group
276            */
277            @Override
278            public void setName(java.lang.String name) {
279                    _clusterGroup.setName(name);
280            }
281    
282            @Override
283            public void setNew(boolean n) {
284                    _clusterGroup.setNew(n);
285            }
286    
287            /**
288            * Sets the primary key of this cluster group.
289            *
290            * @param primaryKey the primary key of this cluster group
291            */
292            @Override
293            public void setPrimaryKey(long primaryKey) {
294                    _clusterGroup.setPrimaryKey(primaryKey);
295            }
296    
297            @Override
298            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
299                    _clusterGroup.setPrimaryKeyObj(primaryKeyObj);
300            }
301    
302            /**
303            * Sets whether this cluster group is whole cluster.
304            *
305            * @param wholeCluster the whole cluster of this cluster group
306            */
307            @Override
308            public void setWholeCluster(boolean wholeCluster) {
309                    _clusterGroup.setWholeCluster(wholeCluster);
310            }
311    
312            @Override
313            public CacheModel<com.liferay.portal.kernel.model.ClusterGroup> toCacheModel() {
314                    return _clusterGroup.toCacheModel();
315            }
316    
317            @Override
318            public com.liferay.portal.kernel.model.ClusterGroup toEscapedModel() {
319                    return new ClusterGroupWrapper(_clusterGroup.toEscapedModel());
320            }
321    
322            @Override
323            public java.lang.String toString() {
324                    return _clusterGroup.toString();
325            }
326    
327            @Override
328            public com.liferay.portal.kernel.model.ClusterGroup toUnescapedModel() {
329                    return new ClusterGroupWrapper(_clusterGroup.toUnescapedModel());
330            }
331    
332            @Override
333            public java.lang.String toXmlString() {
334                    return _clusterGroup.toXmlString();
335            }
336    
337            @Override
338            public boolean equals(Object obj) {
339                    if (this == obj) {
340                            return true;
341                    }
342    
343                    if (!(obj instanceof ClusterGroupWrapper)) {
344                            return false;
345                    }
346    
347                    ClusterGroupWrapper clusterGroupWrapper = (ClusterGroupWrapper)obj;
348    
349                    if (Validator.equals(_clusterGroup, clusterGroupWrapper._clusterGroup)) {
350                            return true;
351                    }
352    
353                    return false;
354            }
355    
356            @Override
357            public ClusterGroup getWrappedModel() {
358                    return _clusterGroup;
359            }
360    
361            @Override
362            public boolean isEntityCacheEnabled() {
363                    return _clusterGroup.isEntityCacheEnabled();
364            }
365    
366            @Override
367            public boolean isFinderCacheEnabled() {
368                    return _clusterGroup.isFinderCacheEnabled();
369            }
370    
371            @Override
372            public void resetOriginalValues() {
373                    _clusterGroup.resetOriginalValues();
374            }
375    
376            private final ClusterGroup _clusterGroup;
377    }