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