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