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