001
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
023 import java.io.Serializable;
024
025 import java.util.HashMap;
026 import java.util.Map;
027 import java.util.Objects;
028
029
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 CacheModel<ClusterGroup> toCacheModel() {
103 return _clusterGroup.toCacheModel();
104 }
105
106 @Override
107 public ClusterGroup toEscapedModel() {
108 return new ClusterGroupWrapper(_clusterGroup.toEscapedModel());
109 }
110
111 @Override
112 public ClusterGroup toUnescapedModel() {
113 return new ClusterGroupWrapper(_clusterGroup.toUnescapedModel());
114 }
115
116
121 @Override
122 public boolean getWholeCluster() {
123 return _clusterGroup.getWholeCluster();
124 }
125
126 @Override
127 public boolean isCachedModel() {
128 return _clusterGroup.isCachedModel();
129 }
130
131 @Override
132 public boolean isEscapedModel() {
133 return _clusterGroup.isEscapedModel();
134 }
135
136 @Override
137 public boolean isNew() {
138 return _clusterGroup.isNew();
139 }
140
141
146 @Override
147 public boolean isWholeCluster() {
148 return _clusterGroup.isWholeCluster();
149 }
150
151 @Override
152 public ExpandoBridge getExpandoBridge() {
153 return _clusterGroup.getExpandoBridge();
154 }
155
156 @Override
157 public int compareTo(ClusterGroup clusterGroup) {
158 return _clusterGroup.compareTo(clusterGroup);
159 }
160
161 @Override
162 public int hashCode() {
163 return _clusterGroup.hashCode();
164 }
165
166 @Override
167 public Serializable getPrimaryKeyObj() {
168 return _clusterGroup.getPrimaryKeyObj();
169 }
170
171 @Override
172 public java.lang.Object clone() {
173 return new ClusterGroupWrapper((ClusterGroup)_clusterGroup.clone());
174 }
175
176
181 @Override
182 public java.lang.String getClusterNodeIds() {
183 return _clusterGroup.getClusterNodeIds();
184 }
185
186
191 @Override
192 public java.lang.String getName() {
193 return _clusterGroup.getName();
194 }
195
196 @Override
197 public java.lang.String toString() {
198 return _clusterGroup.toString();
199 }
200
201 @Override
202 public java.lang.String toXmlString() {
203 return _clusterGroup.toXmlString();
204 }
205
206 @Override
207 public java.lang.String[] getClusterNodeIdsArray() {
208 return _clusterGroup.getClusterNodeIdsArray();
209 }
210
211
216 @Override
217 public long getClusterGroupId() {
218 return _clusterGroup.getClusterGroupId();
219 }
220
221
226 @Override
227 public long getMvccVersion() {
228 return _clusterGroup.getMvccVersion();
229 }
230
231
236 @Override
237 public long getPrimaryKey() {
238 return _clusterGroup.getPrimaryKey();
239 }
240
241 @Override
242 public void persist() {
243 _clusterGroup.persist();
244 }
245
246 @Override
247 public void setCachedModel(boolean cachedModel) {
248 _clusterGroup.setCachedModel(cachedModel);
249 }
250
251
256 @Override
257 public void setClusterGroupId(long clusterGroupId) {
258 _clusterGroup.setClusterGroupId(clusterGroupId);
259 }
260
261
266 @Override
267 public void setClusterNodeIds(java.lang.String clusterNodeIds) {
268 _clusterGroup.setClusterNodeIds(clusterNodeIds);
269 }
270
271 @Override
272 public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
273 _clusterGroup.setExpandoBridgeAttributes(baseModel);
274 }
275
276 @Override
277 public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
278 _clusterGroup.setExpandoBridgeAttributes(expandoBridge);
279 }
280
281 @Override
282 public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
283 _clusterGroup.setExpandoBridgeAttributes(serviceContext);
284 }
285
286
291 @Override
292 public void setMvccVersion(long mvccVersion) {
293 _clusterGroup.setMvccVersion(mvccVersion);
294 }
295
296
301 @Override
302 public void setName(java.lang.String name) {
303 _clusterGroup.setName(name);
304 }
305
306 @Override
307 public void setNew(boolean n) {
308 _clusterGroup.setNew(n);
309 }
310
311
316 @Override
317 public void setPrimaryKey(long primaryKey) {
318 _clusterGroup.setPrimaryKey(primaryKey);
319 }
320
321 @Override
322 public void setPrimaryKeyObj(Serializable primaryKeyObj) {
323 _clusterGroup.setPrimaryKeyObj(primaryKeyObj);
324 }
325
326
331 @Override
332 public void setWholeCluster(boolean wholeCluster) {
333 _clusterGroup.setWholeCluster(wholeCluster);
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 (Objects.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 }