001
014
015 package com.liferay.portlet.expando.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018 import com.liferay.portal.model.ModelWrapper;
019
020 import java.util.HashMap;
021 import java.util.Map;
022
023
032 public class ExpandoColumnWrapper implements ExpandoColumn,
033 ModelWrapper<ExpandoColumn> {
034 public ExpandoColumnWrapper(ExpandoColumn expandoColumn) {
035 _expandoColumn = expandoColumn;
036 }
037
038 public Class<?> getModelClass() {
039 return ExpandoColumn.class;
040 }
041
042 public String getModelClassName() {
043 return ExpandoColumn.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("columnId", getColumnId());
050 attributes.put("companyId", getCompanyId());
051 attributes.put("tableId", getTableId());
052 attributes.put("name", getName());
053 attributes.put("type", getType());
054 attributes.put("defaultData", getDefaultData());
055 attributes.put("typeSettings", getTypeSettings());
056
057 return attributes;
058 }
059
060 public void setModelAttributes(Map<String, Object> attributes) {
061 Long columnId = (Long)attributes.get("columnId");
062
063 if (columnId != null) {
064 setColumnId(columnId);
065 }
066
067 Long companyId = (Long)attributes.get("companyId");
068
069 if (companyId != null) {
070 setCompanyId(companyId);
071 }
072
073 Long tableId = (Long)attributes.get("tableId");
074
075 if (tableId != null) {
076 setTableId(tableId);
077 }
078
079 String name = (String)attributes.get("name");
080
081 if (name != null) {
082 setName(name);
083 }
084
085 Integer type = (Integer)attributes.get("type");
086
087 if (type != null) {
088 setType(type);
089 }
090
091 String defaultData = (String)attributes.get("defaultData");
092
093 if (defaultData != null) {
094 setDefaultData(defaultData);
095 }
096
097 String typeSettings = (String)attributes.get("typeSettings");
098
099 if (typeSettings != null) {
100 setTypeSettings(typeSettings);
101 }
102 }
103
104
109 public long getPrimaryKey() {
110 return _expandoColumn.getPrimaryKey();
111 }
112
113
118 public void setPrimaryKey(long primaryKey) {
119 _expandoColumn.setPrimaryKey(primaryKey);
120 }
121
122
127 public long getColumnId() {
128 return _expandoColumn.getColumnId();
129 }
130
131
136 public void setColumnId(long columnId) {
137 _expandoColumn.setColumnId(columnId);
138 }
139
140
145 public long getCompanyId() {
146 return _expandoColumn.getCompanyId();
147 }
148
149
154 public void setCompanyId(long companyId) {
155 _expandoColumn.setCompanyId(companyId);
156 }
157
158
163 public long getTableId() {
164 return _expandoColumn.getTableId();
165 }
166
167
172 public void setTableId(long tableId) {
173 _expandoColumn.setTableId(tableId);
174 }
175
176
181 public java.lang.String getName() {
182 return _expandoColumn.getName();
183 }
184
185
190 public void setName(java.lang.String name) {
191 _expandoColumn.setName(name);
192 }
193
194
199 public int getType() {
200 return _expandoColumn.getType();
201 }
202
203
208 public void setType(int type) {
209 _expandoColumn.setType(type);
210 }
211
212
217 public java.lang.String getDefaultData() {
218 return _expandoColumn.getDefaultData();
219 }
220
221
226 public void setDefaultData(java.lang.String defaultData) {
227 _expandoColumn.setDefaultData(defaultData);
228 }
229
230
235 public java.lang.String getTypeSettings() {
236 return _expandoColumn.getTypeSettings();
237 }
238
239
244 public void setTypeSettings(java.lang.String typeSettings) {
245 _expandoColumn.setTypeSettings(typeSettings);
246 }
247
248 public boolean isNew() {
249 return _expandoColumn.isNew();
250 }
251
252 public void setNew(boolean n) {
253 _expandoColumn.setNew(n);
254 }
255
256 public boolean isCachedModel() {
257 return _expandoColumn.isCachedModel();
258 }
259
260 public void setCachedModel(boolean cachedModel) {
261 _expandoColumn.setCachedModel(cachedModel);
262 }
263
264 public boolean isEscapedModel() {
265 return _expandoColumn.isEscapedModel();
266 }
267
268 public java.io.Serializable getPrimaryKeyObj() {
269 return _expandoColumn.getPrimaryKeyObj();
270 }
271
272 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
273 _expandoColumn.setPrimaryKeyObj(primaryKeyObj);
274 }
275
276 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
277 return _expandoColumn.getExpandoBridge();
278 }
279
280 public void setExpandoBridgeAttributes(
281 com.liferay.portal.service.ServiceContext serviceContext) {
282 _expandoColumn.setExpandoBridgeAttributes(serviceContext);
283 }
284
285 @Override
286 public java.lang.Object clone() {
287 return new ExpandoColumnWrapper((ExpandoColumn)_expandoColumn.clone());
288 }
289
290 public int compareTo(
291 com.liferay.portlet.expando.model.ExpandoColumn expandoColumn) {
292 return _expandoColumn.compareTo(expandoColumn);
293 }
294
295 @Override
296 public int hashCode() {
297 return _expandoColumn.hashCode();
298 }
299
300 public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoColumn> toCacheModel() {
301 return _expandoColumn.toCacheModel();
302 }
303
304 public com.liferay.portlet.expando.model.ExpandoColumn toEscapedModel() {
305 return new ExpandoColumnWrapper(_expandoColumn.toEscapedModel());
306 }
307
308 public com.liferay.portlet.expando.model.ExpandoColumn toUnescapedModel() {
309 return new ExpandoColumnWrapper(_expandoColumn.toUnescapedModel());
310 }
311
312 @Override
313 public java.lang.String toString() {
314 return _expandoColumn.toString();
315 }
316
317 public java.lang.String toXmlString() {
318 return _expandoColumn.toXmlString();
319 }
320
321 public void persist()
322 throws com.liferay.portal.kernel.exception.SystemException {
323 _expandoColumn.persist();
324 }
325
326 public java.io.Serializable getDefaultValue() {
327 return _expandoColumn.getDefaultValue();
328 }
329
330 public java.lang.String getDisplayName(java.util.Locale locale) {
331 return _expandoColumn.getDisplayName(locale);
332 }
333
334 public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties() {
335 return _expandoColumn.getTypeSettingsProperties();
336 }
337
338 public void setTypeSettingsProperties(
339 com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
340 _expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
341 }
342
343 @Override
344 public boolean equals(Object obj) {
345 if (this == obj) {
346 return true;
347 }
348
349 if (!(obj instanceof ExpandoColumnWrapper)) {
350 return false;
351 }
352
353 ExpandoColumnWrapper expandoColumnWrapper = (ExpandoColumnWrapper)obj;
354
355 if (Validator.equals(_expandoColumn, expandoColumnWrapper._expandoColumn)) {
356 return true;
357 }
358
359 return false;
360 }
361
362
365 public ExpandoColumn getWrappedExpandoColumn() {
366 return _expandoColumn;
367 }
368
369 public ExpandoColumn getWrappedModel() {
370 return _expandoColumn;
371 }
372
373 public void resetOriginalValues() {
374 _expandoColumn.resetOriginalValues();
375 }
376
377 private ExpandoColumn _expandoColumn;
378 }