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 com.liferay.portlet.expando.model.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 java.util.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(
236                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
237                    _expandoRow.setExpandoBridgeAttributes(expandoBridge);
238            }
239    
240            @Override
241            public void setExpandoBridgeAttributes(
242                    com.liferay.portal.service.ServiceContext serviceContext) {
243                    _expandoRow.setExpandoBridgeAttributes(serviceContext);
244            }
245    
246            /**
247            * Sets the modified date of this expando row.
248            *
249            * @param modifiedDate the modified date of this expando row
250            */
251            @Override
252            public void setModifiedDate(java.util.Date modifiedDate) {
253                    _expandoRow.setModifiedDate(modifiedDate);
254            }
255    
256            @Override
257            public void setNew(boolean n) {
258                    _expandoRow.setNew(n);
259            }
260    
261            /**
262            * Sets the primary key of this expando row.
263            *
264            * @param primaryKey the primary key of this expando row
265            */
266            @Override
267            public void setPrimaryKey(long primaryKey) {
268                    _expandoRow.setPrimaryKey(primaryKey);
269            }
270    
271            @Override
272            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
273                    _expandoRow.setPrimaryKeyObj(primaryKeyObj);
274            }
275    
276            /**
277            * Sets the row ID of this expando row.
278            *
279            * @param rowId the row ID of this expando row
280            */
281            @Override
282            public void setRowId(long rowId) {
283                    _expandoRow.setRowId(rowId);
284            }
285    
286            /**
287            * Sets the table ID of this expando row.
288            *
289            * @param tableId the table ID of this expando row
290            */
291            @Override
292            public void setTableId(long tableId) {
293                    _expandoRow.setTableId(tableId);
294            }
295    
296            @Override
297            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoRow> toCacheModel() {
298                    return _expandoRow.toCacheModel();
299            }
300    
301            @Override
302            public com.liferay.portlet.expando.model.ExpandoRow toEscapedModel() {
303                    return new ExpandoRowWrapper(_expandoRow.toEscapedModel());
304            }
305    
306            @Override
307            public java.lang.String toString() {
308                    return _expandoRow.toString();
309            }
310    
311            @Override
312            public com.liferay.portlet.expando.model.ExpandoRow toUnescapedModel() {
313                    return new ExpandoRowWrapper(_expandoRow.toUnescapedModel());
314            }
315    
316            @Override
317            public java.lang.String toXmlString() {
318                    return _expandoRow.toXmlString();
319            }
320    
321            @Override
322            public boolean equals(Object obj) {
323                    if (this == obj) {
324                            return true;
325                    }
326    
327                    if (!(obj instanceof ExpandoRowWrapper)) {
328                            return false;
329                    }
330    
331                    ExpandoRowWrapper expandoRowWrapper = (ExpandoRowWrapper)obj;
332    
333                    if (Validator.equals(_expandoRow, expandoRowWrapper._expandoRow)) {
334                            return true;
335                    }
336    
337                    return false;
338            }
339    
340            /**
341             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
342             */
343            @Deprecated
344            public ExpandoRow getWrappedExpandoRow() {
345                    return _expandoRow;
346            }
347    
348            @Override
349            public ExpandoRow getWrappedModel() {
350                    return _expandoRow;
351            }
352    
353            @Override
354            public boolean isEntityCacheEnabled() {
355                    return _expandoRow.isEntityCacheEnabled();
356            }
357    
358            @Override
359            public boolean isFinderCacheEnabled() {
360                    return _expandoRow.isFinderCacheEnabled();
361            }
362    
363            @Override
364            public void resetOriginalValues() {
365                    _expandoRow.resetOriginalValues();
366            }
367    
368            private final ExpandoRow _expandoRow;
369    }