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