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