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