001
014
015 package com.liferay.portlet.expando.model;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.util.Validator;
020 import com.liferay.portal.model.ModelWrapper;
021
022 import java.util.HashMap;
023 import java.util.Map;
024
025
034 @ProviderType
035 public class ExpandoColumnWrapper implements ExpandoColumn,
036 ModelWrapper<ExpandoColumn> {
037 public ExpandoColumnWrapper(ExpandoColumn expandoColumn) {
038 _expandoColumn = expandoColumn;
039 }
040
041 @Override
042 public Class<?> getModelClass() {
043 return ExpandoColumn.class;
044 }
045
046 @Override
047 public String getModelClassName() {
048 return ExpandoColumn.class.getName();
049 }
050
051 @Override
052 public Map<String, Object> getModelAttributes() {
053 Map<String, Object> attributes = new HashMap<String, Object>();
054
055 attributes.put("columnId", getColumnId());
056 attributes.put("companyId", getCompanyId());
057 attributes.put("tableId", getTableId());
058 attributes.put("name", getName());
059 attributes.put("type", getType());
060 attributes.put("defaultData", getDefaultData());
061 attributes.put("typeSettings", getTypeSettings());
062
063 return attributes;
064 }
065
066 @Override
067 public void setModelAttributes(Map<String, Object> attributes) {
068 Long columnId = (Long)attributes.get("columnId");
069
070 if (columnId != null) {
071 setColumnId(columnId);
072 }
073
074 Long companyId = (Long)attributes.get("companyId");
075
076 if (companyId != null) {
077 setCompanyId(companyId);
078 }
079
080 Long tableId = (Long)attributes.get("tableId");
081
082 if (tableId != null) {
083 setTableId(tableId);
084 }
085
086 String name = (String)attributes.get("name");
087
088 if (name != null) {
089 setName(name);
090 }
091
092 Integer type = (Integer)attributes.get("type");
093
094 if (type != null) {
095 setType(type);
096 }
097
098 String defaultData = (String)attributes.get("defaultData");
099
100 if (defaultData != null) {
101 setDefaultData(defaultData);
102 }
103
104 String typeSettings = (String)attributes.get("typeSettings");
105
106 if (typeSettings != null) {
107 setTypeSettings(typeSettings);
108 }
109 }
110
111
116 @Override
117 public long getPrimaryKey() {
118 return _expandoColumn.getPrimaryKey();
119 }
120
121
126 @Override
127 public void setPrimaryKey(long primaryKey) {
128 _expandoColumn.setPrimaryKey(primaryKey);
129 }
130
131
136 @Override
137 public long getColumnId() {
138 return _expandoColumn.getColumnId();
139 }
140
141
146 @Override
147 public void setColumnId(long columnId) {
148 _expandoColumn.setColumnId(columnId);
149 }
150
151
156 @Override
157 public long getCompanyId() {
158 return _expandoColumn.getCompanyId();
159 }
160
161
166 @Override
167 public void setCompanyId(long companyId) {
168 _expandoColumn.setCompanyId(companyId);
169 }
170
171
176 @Override
177 public long getTableId() {
178 return _expandoColumn.getTableId();
179 }
180
181
186 @Override
187 public void setTableId(long tableId) {
188 _expandoColumn.setTableId(tableId);
189 }
190
191
196 @Override
197 public java.lang.String getName() {
198 return _expandoColumn.getName();
199 }
200
201
206 @Override
207 public void setName(java.lang.String name) {
208 _expandoColumn.setName(name);
209 }
210
211
216 @Override
217 public int getType() {
218 return _expandoColumn.getType();
219 }
220
221
226 @Override
227 public void setType(int type) {
228 _expandoColumn.setType(type);
229 }
230
231
236 @Override
237 public java.lang.String getDefaultData() {
238 return _expandoColumn.getDefaultData();
239 }
240
241
246 @Override
247 public void setDefaultData(java.lang.String defaultData) {
248 _expandoColumn.setDefaultData(defaultData);
249 }
250
251
256 @Override
257 public java.lang.String getTypeSettings() {
258 return _expandoColumn.getTypeSettings();
259 }
260
261
266 @Override
267 public void setTypeSettings(java.lang.String typeSettings) {
268 _expandoColumn.setTypeSettings(typeSettings);
269 }
270
271 @Override
272 public boolean isNew() {
273 return _expandoColumn.isNew();
274 }
275
276 @Override
277 public void setNew(boolean n) {
278 _expandoColumn.setNew(n);
279 }
280
281 @Override
282 public boolean isCachedModel() {
283 return _expandoColumn.isCachedModel();
284 }
285
286 @Override
287 public void setCachedModel(boolean cachedModel) {
288 _expandoColumn.setCachedModel(cachedModel);
289 }
290
291 @Override
292 public boolean isEscapedModel() {
293 return _expandoColumn.isEscapedModel();
294 }
295
296 @Override
297 public java.io.Serializable getPrimaryKeyObj() {
298 return _expandoColumn.getPrimaryKeyObj();
299 }
300
301 @Override
302 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
303 _expandoColumn.setPrimaryKeyObj(primaryKeyObj);
304 }
305
306 @Override
307 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
308 return _expandoColumn.getExpandoBridge();
309 }
310
311 @Override
312 public void setExpandoBridgeAttributes(
313 com.liferay.portal.model.BaseModel<?> baseModel) {
314 _expandoColumn.setExpandoBridgeAttributes(baseModel);
315 }
316
317 @Override
318 public void setExpandoBridgeAttributes(
319 com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
320 _expandoColumn.setExpandoBridgeAttributes(expandoBridge);
321 }
322
323 @Override
324 public void setExpandoBridgeAttributes(
325 com.liferay.portal.service.ServiceContext serviceContext) {
326 _expandoColumn.setExpandoBridgeAttributes(serviceContext);
327 }
328
329 @Override
330 public java.lang.Object clone() {
331 return new ExpandoColumnWrapper((ExpandoColumn)_expandoColumn.clone());
332 }
333
334 @Override
335 public int compareTo(
336 com.liferay.portlet.expando.model.ExpandoColumn expandoColumn) {
337 return _expandoColumn.compareTo(expandoColumn);
338 }
339
340 @Override
341 public int hashCode() {
342 return _expandoColumn.hashCode();
343 }
344
345 @Override
346 public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoColumn> toCacheModel() {
347 return _expandoColumn.toCacheModel();
348 }
349
350 @Override
351 public com.liferay.portlet.expando.model.ExpandoColumn toEscapedModel() {
352 return new ExpandoColumnWrapper(_expandoColumn.toEscapedModel());
353 }
354
355 @Override
356 public com.liferay.portlet.expando.model.ExpandoColumn toUnescapedModel() {
357 return new ExpandoColumnWrapper(_expandoColumn.toUnescapedModel());
358 }
359
360 @Override
361 public java.lang.String toString() {
362 return _expandoColumn.toString();
363 }
364
365 @Override
366 public java.lang.String toXmlString() {
367 return _expandoColumn.toXmlString();
368 }
369
370 @Override
371 public void persist()
372 throws com.liferay.portal.kernel.exception.SystemException {
373 _expandoColumn.persist();
374 }
375
376 @Override
377 public java.io.Serializable getDefaultValue() {
378 return _expandoColumn.getDefaultValue();
379 }
380
381 @Override
382 public java.lang.String getDisplayName(java.util.Locale locale) {
383 return _expandoColumn.getDisplayName(locale);
384 }
385
386 @Override
387 public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties() {
388 return _expandoColumn.getTypeSettingsProperties();
389 }
390
391 @Override
392 public void setTypeSettingsProperties(
393 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
394 _expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
395 }
396
397 @Override
398 public boolean equals(Object obj) {
399 if (this == obj) {
400 return true;
401 }
402
403 if (!(obj instanceof ExpandoColumnWrapper)) {
404 return false;
405 }
406
407 ExpandoColumnWrapper expandoColumnWrapper = (ExpandoColumnWrapper)obj;
408
409 if (Validator.equals(_expandoColumn, expandoColumnWrapper._expandoColumn)) {
410 return true;
411 }
412
413 return false;
414 }
415
416
419 public ExpandoColumn getWrappedExpandoColumn() {
420 return _expandoColumn;
421 }
422
423 @Override
424 public ExpandoColumn getWrappedModel() {
425 return _expandoColumn;
426 }
427
428 @Override
429 public void resetOriginalValues() {
430 _expandoColumn.resetOriginalValues();
431 }
432
433 private ExpandoColumn _expandoColumn;
434 }