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