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 com.liferay.portlet.expando.model.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(
295                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
296                    _expandoColumn.setExpandoBridgeAttributes(expandoBridge);
297            }
298    
299            @Override
300            public void setExpandoBridgeAttributes(
301                    com.liferay.portal.service.ServiceContext serviceContext) {
302                    _expandoColumn.setExpandoBridgeAttributes(serviceContext);
303            }
304    
305            /**
306            * Sets the name of this expando column.
307            *
308            * @param name the name of this expando column
309            */
310            @Override
311            public void setName(java.lang.String name) {
312                    _expandoColumn.setName(name);
313            }
314    
315            @Override
316            public void setNew(boolean n) {
317                    _expandoColumn.setNew(n);
318            }
319    
320            /**
321            * Sets the primary key of this expando column.
322            *
323            * @param primaryKey the primary key of this expando column
324            */
325            @Override
326            public void setPrimaryKey(long primaryKey) {
327                    _expandoColumn.setPrimaryKey(primaryKey);
328            }
329    
330            @Override
331            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
332                    _expandoColumn.setPrimaryKeyObj(primaryKeyObj);
333            }
334    
335            /**
336            * Sets the table ID of this expando column.
337            *
338            * @param tableId the table ID of this expando column
339            */
340            @Override
341            public void setTableId(long tableId) {
342                    _expandoColumn.setTableId(tableId);
343            }
344    
345            /**
346            * Sets the type of this expando column.
347            *
348            * @param type the type of this expando column
349            */
350            @Override
351            public void setType(int type) {
352                    _expandoColumn.setType(type);
353            }
354    
355            /**
356            * Sets the type settings of this expando column.
357            *
358            * @param typeSettings the type settings of this expando column
359            */
360            @Override
361            public void setTypeSettings(java.lang.String typeSettings) {
362                    _expandoColumn.setTypeSettings(typeSettings);
363            }
364    
365            @Override
366            public void setTypeSettingsProperties(
367                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties) {
368                    _expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
369            }
370    
371            @Override
372            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoColumn> toCacheModel() {
373                    return _expandoColumn.toCacheModel();
374            }
375    
376            @Override
377            public com.liferay.portlet.expando.model.ExpandoColumn toEscapedModel() {
378                    return new ExpandoColumnWrapper(_expandoColumn.toEscapedModel());
379            }
380    
381            @Override
382            public java.lang.String toString() {
383                    return _expandoColumn.toString();
384            }
385    
386            @Override
387            public com.liferay.portlet.expando.model.ExpandoColumn toUnescapedModel() {
388                    return new ExpandoColumnWrapper(_expandoColumn.toUnescapedModel());
389            }
390    
391            @Override
392            public java.lang.String toXmlString() {
393                    return _expandoColumn.toXmlString();
394            }
395    
396            @Override
397            public boolean equals(Object obj) {
398                    if (this == obj) {
399                            return true;
400                    }
401    
402                    if (!(obj instanceof ExpandoColumnWrapper)) {
403                            return false;
404                    }
405    
406                    ExpandoColumnWrapper expandoColumnWrapper = (ExpandoColumnWrapper)obj;
407    
408                    if (Validator.equals(_expandoColumn, expandoColumnWrapper._expandoColumn)) {
409                            return true;
410                    }
411    
412                    return false;
413            }
414    
415            /**
416             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
417             */
418            @Deprecated
419            public ExpandoColumn getWrappedExpandoColumn() {
420                    return _expandoColumn;
421            }
422    
423            @Override
424            public ExpandoColumn getWrappedModel() {
425                    return _expandoColumn;
426            }
427    
428            @Override
429            public boolean isEntityCacheEnabled() {
430                    return _expandoColumn.isEntityCacheEnabled();
431            }
432    
433            @Override
434            public boolean isFinderCacheEnabled() {
435                    return _expandoColumn.isFinderCacheEnabled();
436            }
437    
438            @Override
439            public void resetOriginalValues() {
440                    _expandoColumn.resetOriginalValues();
441            }
442    
443            private final ExpandoColumn _expandoColumn;
444    }