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