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