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.shopping.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 ShoppingItemField}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       ShoppingItemField
030     * @generated
031     */
032    public class ShoppingItemFieldWrapper implements ShoppingItemField,
033            ModelWrapper<ShoppingItemField> {
034            public ShoppingItemFieldWrapper(ShoppingItemField shoppingItemField) {
035                    _shoppingItemField = shoppingItemField;
036            }
037    
038            public Class<?> getModelClass() {
039                    return ShoppingItemField.class;
040            }
041    
042            public String getModelClassName() {
043                    return ShoppingItemField.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("itemFieldId", getItemFieldId());
050                    attributes.put("itemId", getItemId());
051                    attributes.put("name", getName());
052                    attributes.put("values", getValues());
053                    attributes.put("description", getDescription());
054    
055                    return attributes;
056            }
057    
058            public void setModelAttributes(Map<String, Object> attributes) {
059                    Long itemFieldId = (Long)attributes.get("itemFieldId");
060    
061                    if (itemFieldId != null) {
062                            setItemFieldId(itemFieldId);
063                    }
064    
065                    Long itemId = (Long)attributes.get("itemId");
066    
067                    if (itemId != null) {
068                            setItemId(itemId);
069                    }
070    
071                    String name = (String)attributes.get("name");
072    
073                    if (name != null) {
074                            setName(name);
075                    }
076    
077                    String values = (String)attributes.get("values");
078    
079                    if (values != null) {
080                            setValues(values);
081                    }
082    
083                    String description = (String)attributes.get("description");
084    
085                    if (description != null) {
086                            setDescription(description);
087                    }
088            }
089    
090            /**
091            * Returns the primary key of this shopping item field.
092            *
093            * @return the primary key of this shopping item field
094            */
095            public long getPrimaryKey() {
096                    return _shoppingItemField.getPrimaryKey();
097            }
098    
099            /**
100            * Sets the primary key of this shopping item field.
101            *
102            * @param primaryKey the primary key of this shopping item field
103            */
104            public void setPrimaryKey(long primaryKey) {
105                    _shoppingItemField.setPrimaryKey(primaryKey);
106            }
107    
108            /**
109            * Returns the item field ID of this shopping item field.
110            *
111            * @return the item field ID of this shopping item field
112            */
113            public long getItemFieldId() {
114                    return _shoppingItemField.getItemFieldId();
115            }
116    
117            /**
118            * Sets the item field ID of this shopping item field.
119            *
120            * @param itemFieldId the item field ID of this shopping item field
121            */
122            public void setItemFieldId(long itemFieldId) {
123                    _shoppingItemField.setItemFieldId(itemFieldId);
124            }
125    
126            /**
127            * Returns the item ID of this shopping item field.
128            *
129            * @return the item ID of this shopping item field
130            */
131            public long getItemId() {
132                    return _shoppingItemField.getItemId();
133            }
134    
135            /**
136            * Sets the item ID of this shopping item field.
137            *
138            * @param itemId the item ID of this shopping item field
139            */
140            public void setItemId(long itemId) {
141                    _shoppingItemField.setItemId(itemId);
142            }
143    
144            /**
145            * Returns the name of this shopping item field.
146            *
147            * @return the name of this shopping item field
148            */
149            public java.lang.String getName() {
150                    return _shoppingItemField.getName();
151            }
152    
153            /**
154            * Sets the name of this shopping item field.
155            *
156            * @param name the name of this shopping item field
157            */
158            public void setName(java.lang.String name) {
159                    _shoppingItemField.setName(name);
160            }
161    
162            /**
163            * Returns the values of this shopping item field.
164            *
165            * @return the values of this shopping item field
166            */
167            public java.lang.String getValues() {
168                    return _shoppingItemField.getValues();
169            }
170    
171            /**
172            * Sets the values of this shopping item field.
173            *
174            * @param values the values of this shopping item field
175            */
176            public void setValues(java.lang.String values) {
177                    _shoppingItemField.setValues(values);
178            }
179    
180            /**
181            * Returns the description of this shopping item field.
182            *
183            * @return the description of this shopping item field
184            */
185            public java.lang.String getDescription() {
186                    return _shoppingItemField.getDescription();
187            }
188    
189            /**
190            * Sets the description of this shopping item field.
191            *
192            * @param description the description of this shopping item field
193            */
194            public void setDescription(java.lang.String description) {
195                    _shoppingItemField.setDescription(description);
196            }
197    
198            public boolean isNew() {
199                    return _shoppingItemField.isNew();
200            }
201    
202            public void setNew(boolean n) {
203                    _shoppingItemField.setNew(n);
204            }
205    
206            public boolean isCachedModel() {
207                    return _shoppingItemField.isCachedModel();
208            }
209    
210            public void setCachedModel(boolean cachedModel) {
211                    _shoppingItemField.setCachedModel(cachedModel);
212            }
213    
214            public boolean isEscapedModel() {
215                    return _shoppingItemField.isEscapedModel();
216            }
217    
218            public java.io.Serializable getPrimaryKeyObj() {
219                    return _shoppingItemField.getPrimaryKeyObj();
220            }
221    
222            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
223                    _shoppingItemField.setPrimaryKeyObj(primaryKeyObj);
224            }
225    
226            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
227                    return _shoppingItemField.getExpandoBridge();
228            }
229    
230            public void setExpandoBridgeAttributes(
231                    com.liferay.portal.service.ServiceContext serviceContext) {
232                    _shoppingItemField.setExpandoBridgeAttributes(serviceContext);
233            }
234    
235            @Override
236            public java.lang.Object clone() {
237                    return new ShoppingItemFieldWrapper((ShoppingItemField)_shoppingItemField.clone());
238            }
239    
240            public int compareTo(
241                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField) {
242                    return _shoppingItemField.compareTo(shoppingItemField);
243            }
244    
245            @Override
246            public int hashCode() {
247                    return _shoppingItemField.hashCode();
248            }
249    
250            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingItemField> toCacheModel() {
251                    return _shoppingItemField.toCacheModel();
252            }
253    
254            public com.liferay.portlet.shopping.model.ShoppingItemField toEscapedModel() {
255                    return new ShoppingItemFieldWrapper(_shoppingItemField.toEscapedModel());
256            }
257    
258            public com.liferay.portlet.shopping.model.ShoppingItemField toUnescapedModel() {
259                    return new ShoppingItemFieldWrapper(_shoppingItemField.toUnescapedModel());
260            }
261    
262            @Override
263            public java.lang.String toString() {
264                    return _shoppingItemField.toString();
265            }
266    
267            public java.lang.String toXmlString() {
268                    return _shoppingItemField.toXmlString();
269            }
270    
271            public void persist()
272                    throws com.liferay.portal.kernel.exception.SystemException {
273                    _shoppingItemField.persist();
274            }
275    
276            public java.lang.String[] getValuesArray() {
277                    return _shoppingItemField.getValuesArray();
278            }
279    
280            public void setValuesArray(java.lang.String[] valuesArray) {
281                    _shoppingItemField.setValuesArray(valuesArray);
282            }
283    
284            @Override
285            public boolean equals(Object obj) {
286                    if (this == obj) {
287                            return true;
288                    }
289    
290                    if (!(obj instanceof ShoppingItemFieldWrapper)) {
291                            return false;
292                    }
293    
294                    ShoppingItemFieldWrapper shoppingItemFieldWrapper = (ShoppingItemFieldWrapper)obj;
295    
296                    if (Validator.equals(_shoppingItemField,
297                                            shoppingItemFieldWrapper._shoppingItemField)) {
298                            return true;
299                    }
300    
301                    return false;
302            }
303    
304            /**
305             * @deprecated Renamed to {@link #getWrappedModel}
306             */
307            public ShoppingItemField getWrappedShoppingItemField() {
308                    return _shoppingItemField;
309            }
310    
311            public ShoppingItemField getWrappedModel() {
312                    return _shoppingItemField;
313            }
314    
315            public void resetOriginalValues() {
316                    _shoppingItemField.resetOriginalValues();
317            }
318    
319            private ShoppingItemField _shoppingItemField;
320    }