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