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