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