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