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.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    /**
024     * <p>
025     * This class is a wrapper for {@link ExpandoColumn}.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ExpandoColumn
030     * @generated
031     */
032    public class ExpandoColumnWrapper implements ExpandoColumn,
033            ModelWrapper<ExpandoColumn> {
034            public ExpandoColumnWrapper(ExpandoColumn expandoColumn) {
035                    _expandoColumn = expandoColumn;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return ExpandoColumn.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return ExpandoColumn.class.getName();
046            }
047    
048            @Override
049            public Map<String, Object> getModelAttributes() {
050                    Map<String, Object> attributes = new HashMap<String, Object>();
051    
052                    attributes.put("columnId", getColumnId());
053                    attributes.put("companyId", getCompanyId());
054                    attributes.put("tableId", getTableId());
055                    attributes.put("name", getName());
056                    attributes.put("type", getType());
057                    attributes.put("defaultData", getDefaultData());
058                    attributes.put("typeSettings", getTypeSettings());
059    
060                    return attributes;
061            }
062    
063            @Override
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long columnId = (Long)attributes.get("columnId");
066    
067                    if (columnId != null) {
068                            setColumnId(columnId);
069                    }
070    
071                    Long companyId = (Long)attributes.get("companyId");
072    
073                    if (companyId != null) {
074                            setCompanyId(companyId);
075                    }
076    
077                    Long tableId = (Long)attributes.get("tableId");
078    
079                    if (tableId != null) {
080                            setTableId(tableId);
081                    }
082    
083                    String name = (String)attributes.get("name");
084    
085                    if (name != null) {
086                            setName(name);
087                    }
088    
089                    Integer type = (Integer)attributes.get("type");
090    
091                    if (type != null) {
092                            setType(type);
093                    }
094    
095                    String defaultData = (String)attributes.get("defaultData");
096    
097                    if (defaultData != null) {
098                            setDefaultData(defaultData);
099                    }
100    
101                    String typeSettings = (String)attributes.get("typeSettings");
102    
103                    if (typeSettings != null) {
104                            setTypeSettings(typeSettings);
105                    }
106            }
107    
108            /**
109            * Returns the primary key of this expando column.
110            *
111            * @return the primary key of this expando column
112            */
113            @Override
114            public long getPrimaryKey() {
115                    return _expandoColumn.getPrimaryKey();
116            }
117    
118            /**
119            * Sets the primary key of this expando column.
120            *
121            * @param primaryKey the primary key of this expando column
122            */
123            @Override
124            public void setPrimaryKey(long primaryKey) {
125                    _expandoColumn.setPrimaryKey(primaryKey);
126            }
127    
128            /**
129            * Returns the column ID of this expando column.
130            *
131            * @return the column ID of this expando column
132            */
133            @Override
134            public long getColumnId() {
135                    return _expandoColumn.getColumnId();
136            }
137    
138            /**
139            * Sets the column ID of this expando column.
140            *
141            * @param columnId the column ID of this expando column
142            */
143            @Override
144            public void setColumnId(long columnId) {
145                    _expandoColumn.setColumnId(columnId);
146            }
147    
148            /**
149            * Returns the company ID of this expando column.
150            *
151            * @return the company ID of this expando column
152            */
153            @Override
154            public long getCompanyId() {
155                    return _expandoColumn.getCompanyId();
156            }
157    
158            /**
159            * Sets the company ID of this expando column.
160            *
161            * @param companyId the company ID of this expando column
162            */
163            @Override
164            public void setCompanyId(long companyId) {
165                    _expandoColumn.setCompanyId(companyId);
166            }
167    
168            /**
169            * Returns the table ID of this expando column.
170            *
171            * @return the table ID of this expando column
172            */
173            @Override
174            public long getTableId() {
175                    return _expandoColumn.getTableId();
176            }
177    
178            /**
179            * Sets the table ID of this expando column.
180            *
181            * @param tableId the table ID of this expando column
182            */
183            @Override
184            public void setTableId(long tableId) {
185                    _expandoColumn.setTableId(tableId);
186            }
187    
188            /**
189            * Returns the name of this expando column.
190            *
191            * @return the name of this expando column
192            */
193            @Override
194            public java.lang.String getName() {
195                    return _expandoColumn.getName();
196            }
197    
198            /**
199            * Sets the name of this expando column.
200            *
201            * @param name the name of this expando column
202            */
203            @Override
204            public void setName(java.lang.String name) {
205                    _expandoColumn.setName(name);
206            }
207    
208            /**
209            * Returns the type of this expando column.
210            *
211            * @return the type of this expando column
212            */
213            @Override
214            public int getType() {
215                    return _expandoColumn.getType();
216            }
217    
218            /**
219            * Sets the type of this expando column.
220            *
221            * @param type the type of this expando column
222            */
223            @Override
224            public void setType(int type) {
225                    _expandoColumn.setType(type);
226            }
227    
228            /**
229            * Returns the default data of this expando column.
230            *
231            * @return the default data of this expando column
232            */
233            @Override
234            public java.lang.String getDefaultData() {
235                    return _expandoColumn.getDefaultData();
236            }
237    
238            /**
239            * Sets the default data of this expando column.
240            *
241            * @param defaultData the default data of this expando column
242            */
243            @Override
244            public void setDefaultData(java.lang.String defaultData) {
245                    _expandoColumn.setDefaultData(defaultData);
246            }
247    
248            /**
249            * Returns the type settings of this expando column.
250            *
251            * @return the type settings of this expando column
252            */
253            @Override
254            public java.lang.String getTypeSettings() {
255                    return _expandoColumn.getTypeSettings();
256            }
257    
258            /**
259            * Sets the type settings of this expando column.
260            *
261            * @param typeSettings the type settings of this expando column
262            */
263            @Override
264            public void setTypeSettings(java.lang.String typeSettings) {
265                    _expandoColumn.setTypeSettings(typeSettings);
266            }
267    
268            @Override
269            public boolean isNew() {
270                    return _expandoColumn.isNew();
271            }
272    
273            @Override
274            public void setNew(boolean n) {
275                    _expandoColumn.setNew(n);
276            }
277    
278            @Override
279            public boolean isCachedModel() {
280                    return _expandoColumn.isCachedModel();
281            }
282    
283            @Override
284            public void setCachedModel(boolean cachedModel) {
285                    _expandoColumn.setCachedModel(cachedModel);
286            }
287    
288            @Override
289            public boolean isEscapedModel() {
290                    return _expandoColumn.isEscapedModel();
291            }
292    
293            @Override
294            public java.io.Serializable getPrimaryKeyObj() {
295                    return _expandoColumn.getPrimaryKeyObj();
296            }
297    
298            @Override
299            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
300                    _expandoColumn.setPrimaryKeyObj(primaryKeyObj);
301            }
302    
303            @Override
304            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
305                    return _expandoColumn.getExpandoBridge();
306            }
307    
308            @Override
309            public void setExpandoBridgeAttributes(
310                    com.liferay.portal.model.BaseModel<?> baseModel) {
311                    _expandoColumn.setExpandoBridgeAttributes(baseModel);
312            }
313    
314            @Override
315            public void setExpandoBridgeAttributes(
316                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
317                    _expandoColumn.setExpandoBridgeAttributes(expandoBridge);
318            }
319    
320            @Override
321            public void setExpandoBridgeAttributes(
322                    com.liferay.portal.service.ServiceContext serviceContext) {
323                    _expandoColumn.setExpandoBridgeAttributes(serviceContext);
324            }
325    
326            @Override
327            public java.lang.Object clone() {
328                    return new ExpandoColumnWrapper((ExpandoColumn)_expandoColumn.clone());
329            }
330    
331            @Override
332            public int compareTo(
333                    com.liferay.portlet.expando.model.ExpandoColumn expandoColumn) {
334                    return _expandoColumn.compareTo(expandoColumn);
335            }
336    
337            @Override
338            public int hashCode() {
339                    return _expandoColumn.hashCode();
340            }
341    
342            @Override
343            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoColumn> toCacheModel() {
344                    return _expandoColumn.toCacheModel();
345            }
346    
347            @Override
348            public com.liferay.portlet.expando.model.ExpandoColumn toEscapedModel() {
349                    return new ExpandoColumnWrapper(_expandoColumn.toEscapedModel());
350            }
351    
352            @Override
353            public com.liferay.portlet.expando.model.ExpandoColumn toUnescapedModel() {
354                    return new ExpandoColumnWrapper(_expandoColumn.toUnescapedModel());
355            }
356    
357            @Override
358            public java.lang.String toString() {
359                    return _expandoColumn.toString();
360            }
361    
362            @Override
363            public java.lang.String toXmlString() {
364                    return _expandoColumn.toXmlString();
365            }
366    
367            @Override
368            public void persist()
369                    throws com.liferay.portal.kernel.exception.SystemException {
370                    _expandoColumn.persist();
371            }
372    
373            @Override
374            public java.io.Serializable getDefaultValue() {
375                    return _expandoColumn.getDefaultValue();
376            }
377    
378            @Override
379            public java.lang.String getDisplayName(java.util.Locale locale) {
380                    return _expandoColumn.getDisplayName(locale);
381            }
382    
383            @Override
384            public com.liferay.portal.kernel.util.UnicodeProperties getTypeSettingsProperties() {
385                    return _expandoColumn.getTypeSettingsProperties();
386            }
387    
388            @Override
389            public void setTypeSettingsProperties(
390                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
391                    _expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
392            }
393    
394            @Override
395            public boolean equals(Object obj) {
396                    if (this == obj) {
397                            return true;
398                    }
399    
400                    if (!(obj instanceof ExpandoColumnWrapper)) {
401                            return false;
402                    }
403    
404                    ExpandoColumnWrapper expandoColumnWrapper = (ExpandoColumnWrapper)obj;
405    
406                    if (Validator.equals(_expandoColumn, expandoColumnWrapper._expandoColumn)) {
407                            return true;
408                    }
409    
410                    return false;
411            }
412    
413            /**
414             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
415             */
416            public ExpandoColumn getWrappedExpandoColumn() {
417                    return _expandoColumn;
418            }
419    
420            @Override
421            public ExpandoColumn getWrappedModel() {
422                    return _expandoColumn;
423            }
424    
425            @Override
426            public void resetOriginalValues() {
427                    _expandoColumn.resetOriginalValues();
428            }
429    
430            private ExpandoColumn _expandoColumn;
431    }