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 ExpandoTable}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       ExpandoTable
030     * @generated
031     */
032    public class ExpandoTableWrapper implements ExpandoTable,
033            ModelWrapper<ExpandoTable> {
034            public ExpandoTableWrapper(ExpandoTable expandoTable) {
035                    _expandoTable = expandoTable;
036            }
037    
038            public Class<?> getModelClass() {
039                    return ExpandoTable.class;
040            }
041    
042            public String getModelClassName() {
043                    return ExpandoTable.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("tableId", getTableId());
050                    attributes.put("companyId", getCompanyId());
051                    attributes.put("classNameId", getClassNameId());
052                    attributes.put("name", getName());
053    
054                    return attributes;
055            }
056    
057            public void setModelAttributes(Map<String, Object> attributes) {
058                    Long tableId = (Long)attributes.get("tableId");
059    
060                    if (tableId != null) {
061                            setTableId(tableId);
062                    }
063    
064                    Long companyId = (Long)attributes.get("companyId");
065    
066                    if (companyId != null) {
067                            setCompanyId(companyId);
068                    }
069    
070                    Long classNameId = (Long)attributes.get("classNameId");
071    
072                    if (classNameId != null) {
073                            setClassNameId(classNameId);
074                    }
075    
076                    String name = (String)attributes.get("name");
077    
078                    if (name != null) {
079                            setName(name);
080                    }
081            }
082    
083            /**
084            * Returns the primary key of this expando table.
085            *
086            * @return the primary key of this expando table
087            */
088            public long getPrimaryKey() {
089                    return _expandoTable.getPrimaryKey();
090            }
091    
092            /**
093            * Sets the primary key of this expando table.
094            *
095            * @param primaryKey the primary key of this expando table
096            */
097            public void setPrimaryKey(long primaryKey) {
098                    _expandoTable.setPrimaryKey(primaryKey);
099            }
100    
101            /**
102            * Returns the table ID of this expando table.
103            *
104            * @return the table ID of this expando table
105            */
106            public long getTableId() {
107                    return _expandoTable.getTableId();
108            }
109    
110            /**
111            * Sets the table ID of this expando table.
112            *
113            * @param tableId the table ID of this expando table
114            */
115            public void setTableId(long tableId) {
116                    _expandoTable.setTableId(tableId);
117            }
118    
119            /**
120            * Returns the company ID of this expando table.
121            *
122            * @return the company ID of this expando table
123            */
124            public long getCompanyId() {
125                    return _expandoTable.getCompanyId();
126            }
127    
128            /**
129            * Sets the company ID of this expando table.
130            *
131            * @param companyId the company ID of this expando table
132            */
133            public void setCompanyId(long companyId) {
134                    _expandoTable.setCompanyId(companyId);
135            }
136    
137            /**
138            * Returns the fully qualified class name of this expando table.
139            *
140            * @return the fully qualified class name of this expando table
141            */
142            public java.lang.String getClassName() {
143                    return _expandoTable.getClassName();
144            }
145    
146            public void setClassName(java.lang.String className) {
147                    _expandoTable.setClassName(className);
148            }
149    
150            /**
151            * Returns the class name ID of this expando table.
152            *
153            * @return the class name ID of this expando table
154            */
155            public long getClassNameId() {
156                    return _expandoTable.getClassNameId();
157            }
158    
159            /**
160            * Sets the class name ID of this expando table.
161            *
162            * @param classNameId the class name ID of this expando table
163            */
164            public void setClassNameId(long classNameId) {
165                    _expandoTable.setClassNameId(classNameId);
166            }
167    
168            /**
169            * Returns the name of this expando table.
170            *
171            * @return the name of this expando table
172            */
173            public java.lang.String getName() {
174                    return _expandoTable.getName();
175            }
176    
177            /**
178            * Sets the name of this expando table.
179            *
180            * @param name the name of this expando table
181            */
182            public void setName(java.lang.String name) {
183                    _expandoTable.setName(name);
184            }
185    
186            public boolean isNew() {
187                    return _expandoTable.isNew();
188            }
189    
190            public void setNew(boolean n) {
191                    _expandoTable.setNew(n);
192            }
193    
194            public boolean isCachedModel() {
195                    return _expandoTable.isCachedModel();
196            }
197    
198            public void setCachedModel(boolean cachedModel) {
199                    _expandoTable.setCachedModel(cachedModel);
200            }
201    
202            public boolean isEscapedModel() {
203                    return _expandoTable.isEscapedModel();
204            }
205    
206            public java.io.Serializable getPrimaryKeyObj() {
207                    return _expandoTable.getPrimaryKeyObj();
208            }
209    
210            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
211                    _expandoTable.setPrimaryKeyObj(primaryKeyObj);
212            }
213    
214            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
215                    return _expandoTable.getExpandoBridge();
216            }
217    
218            public void setExpandoBridgeAttributes(
219                    com.liferay.portal.service.ServiceContext serviceContext) {
220                    _expandoTable.setExpandoBridgeAttributes(serviceContext);
221            }
222    
223            @Override
224            public java.lang.Object clone() {
225                    return new ExpandoTableWrapper((ExpandoTable)_expandoTable.clone());
226            }
227    
228            public int compareTo(
229                    com.liferay.portlet.expando.model.ExpandoTable expandoTable) {
230                    return _expandoTable.compareTo(expandoTable);
231            }
232    
233            @Override
234            public int hashCode() {
235                    return _expandoTable.hashCode();
236            }
237    
238            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoTable> toCacheModel() {
239                    return _expandoTable.toCacheModel();
240            }
241    
242            public com.liferay.portlet.expando.model.ExpandoTable toEscapedModel() {
243                    return new ExpandoTableWrapper(_expandoTable.toEscapedModel());
244            }
245    
246            public com.liferay.portlet.expando.model.ExpandoTable toUnescapedModel() {
247                    return new ExpandoTableWrapper(_expandoTable.toUnescapedModel());
248            }
249    
250            @Override
251            public java.lang.String toString() {
252                    return _expandoTable.toString();
253            }
254    
255            public java.lang.String toXmlString() {
256                    return _expandoTable.toXmlString();
257            }
258    
259            public void persist()
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    _expandoTable.persist();
262            }
263    
264            public boolean isDefaultTable() {
265                    return _expandoTable.isDefaultTable();
266            }
267    
268            @Override
269            public boolean equals(Object obj) {
270                    if (this == obj) {
271                            return true;
272                    }
273    
274                    if (!(obj instanceof ExpandoTableWrapper)) {
275                            return false;
276                    }
277    
278                    ExpandoTableWrapper expandoTableWrapper = (ExpandoTableWrapper)obj;
279    
280                    if (Validator.equals(_expandoTable, expandoTableWrapper._expandoTable)) {
281                            return true;
282                    }
283    
284                    return false;
285            }
286    
287            /**
288             * @deprecated Renamed to {@link #getWrappedModel}
289             */
290            public ExpandoTable getWrappedExpandoTable() {
291                    return _expandoTable;
292            }
293    
294            public ExpandoTable getWrappedModel() {
295                    return _expandoTable;
296            }
297    
298            public void resetOriginalValues() {
299                    _expandoTable.resetOriginalValues();
300            }
301    
302            private ExpandoTable _expandoTable;
303    }