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