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