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.Date;
023    import java.util.HashMap;
024    import java.util.Map;
025    
026    /**
027     * <p>
028     * This class is a wrapper for {@link ShoppingOrderItem}.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see ShoppingOrderItem
033     * @generated
034     */
035    @ProviderType
036    public class ShoppingOrderItemWrapper implements ShoppingOrderItem,
037            ModelWrapper<ShoppingOrderItem> {
038            public ShoppingOrderItemWrapper(ShoppingOrderItem shoppingOrderItem) {
039                    _shoppingOrderItem = shoppingOrderItem;
040            }
041    
042            @Override
043            public Class<?> getModelClass() {
044                    return ShoppingOrderItem.class;
045            }
046    
047            @Override
048            public String getModelClassName() {
049                    return ShoppingOrderItem.class.getName();
050            }
051    
052            @Override
053            public Map<String, Object> getModelAttributes() {
054                    Map<String, Object> attributes = new HashMap<String, Object>();
055    
056                    attributes.put("orderItemId", getOrderItemId());
057                    attributes.put("orderId", getOrderId());
058                    attributes.put("itemId", getItemId());
059                    attributes.put("sku", getSku());
060                    attributes.put("name", getName());
061                    attributes.put("description", getDescription());
062                    attributes.put("properties", getProperties());
063                    attributes.put("price", getPrice());
064                    attributes.put("quantity", getQuantity());
065                    attributes.put("shippedDate", getShippedDate());
066    
067                    return attributes;
068            }
069    
070            @Override
071            public void setModelAttributes(Map<String, Object> attributes) {
072                    Long orderItemId = (Long)attributes.get("orderItemId");
073    
074                    if (orderItemId != null) {
075                            setOrderItemId(orderItemId);
076                    }
077    
078                    Long orderId = (Long)attributes.get("orderId");
079    
080                    if (orderId != null) {
081                            setOrderId(orderId);
082                    }
083    
084                    String itemId = (String)attributes.get("itemId");
085    
086                    if (itemId != null) {
087                            setItemId(itemId);
088                    }
089    
090                    String sku = (String)attributes.get("sku");
091    
092                    if (sku != null) {
093                            setSku(sku);
094                    }
095    
096                    String name = (String)attributes.get("name");
097    
098                    if (name != null) {
099                            setName(name);
100                    }
101    
102                    String description = (String)attributes.get("description");
103    
104                    if (description != null) {
105                            setDescription(description);
106                    }
107    
108                    String properties = (String)attributes.get("properties");
109    
110                    if (properties != null) {
111                            setProperties(properties);
112                    }
113    
114                    Double price = (Double)attributes.get("price");
115    
116                    if (price != null) {
117                            setPrice(price);
118                    }
119    
120                    Integer quantity = (Integer)attributes.get("quantity");
121    
122                    if (quantity != null) {
123                            setQuantity(quantity);
124                    }
125    
126                    Date shippedDate = (Date)attributes.get("shippedDate");
127    
128                    if (shippedDate != null) {
129                            setShippedDate(shippedDate);
130                    }
131            }
132    
133            /**
134            * Returns the primary key of this shopping order item.
135            *
136            * @return the primary key of this shopping order item
137            */
138            @Override
139            public long getPrimaryKey() {
140                    return _shoppingOrderItem.getPrimaryKey();
141            }
142    
143            /**
144            * Sets the primary key of this shopping order item.
145            *
146            * @param primaryKey the primary key of this shopping order item
147            */
148            @Override
149            public void setPrimaryKey(long primaryKey) {
150                    _shoppingOrderItem.setPrimaryKey(primaryKey);
151            }
152    
153            /**
154            * Returns the order item ID of this shopping order item.
155            *
156            * @return the order item ID of this shopping order item
157            */
158            @Override
159            public long getOrderItemId() {
160                    return _shoppingOrderItem.getOrderItemId();
161            }
162    
163            /**
164            * Sets the order item ID of this shopping order item.
165            *
166            * @param orderItemId the order item ID of this shopping order item
167            */
168            @Override
169            public void setOrderItemId(long orderItemId) {
170                    _shoppingOrderItem.setOrderItemId(orderItemId);
171            }
172    
173            /**
174            * Returns the order ID of this shopping order item.
175            *
176            * @return the order ID of this shopping order item
177            */
178            @Override
179            public long getOrderId() {
180                    return _shoppingOrderItem.getOrderId();
181            }
182    
183            /**
184            * Sets the order ID of this shopping order item.
185            *
186            * @param orderId the order ID of this shopping order item
187            */
188            @Override
189            public void setOrderId(long orderId) {
190                    _shoppingOrderItem.setOrderId(orderId);
191            }
192    
193            /**
194            * Returns the item ID of this shopping order item.
195            *
196            * @return the item ID of this shopping order item
197            */
198            @Override
199            public java.lang.String getItemId() {
200                    return _shoppingOrderItem.getItemId();
201            }
202    
203            /**
204            * Sets the item ID of this shopping order item.
205            *
206            * @param itemId the item ID of this shopping order item
207            */
208            @Override
209            public void setItemId(java.lang.String itemId) {
210                    _shoppingOrderItem.setItemId(itemId);
211            }
212    
213            /**
214            * Returns the sku of this shopping order item.
215            *
216            * @return the sku of this shopping order item
217            */
218            @Override
219            public java.lang.String getSku() {
220                    return _shoppingOrderItem.getSku();
221            }
222    
223            /**
224            * Sets the sku of this shopping order item.
225            *
226            * @param sku the sku of this shopping order item
227            */
228            @Override
229            public void setSku(java.lang.String sku) {
230                    _shoppingOrderItem.setSku(sku);
231            }
232    
233            /**
234            * Returns the name of this shopping order item.
235            *
236            * @return the name of this shopping order item
237            */
238            @Override
239            public java.lang.String getName() {
240                    return _shoppingOrderItem.getName();
241            }
242    
243            /**
244            * Sets the name of this shopping order item.
245            *
246            * @param name the name of this shopping order item
247            */
248            @Override
249            public void setName(java.lang.String name) {
250                    _shoppingOrderItem.setName(name);
251            }
252    
253            /**
254            * Returns the description of this shopping order item.
255            *
256            * @return the description of this shopping order item
257            */
258            @Override
259            public java.lang.String getDescription() {
260                    return _shoppingOrderItem.getDescription();
261            }
262    
263            /**
264            * Sets the description of this shopping order item.
265            *
266            * @param description the description of this shopping order item
267            */
268            @Override
269            public void setDescription(java.lang.String description) {
270                    _shoppingOrderItem.setDescription(description);
271            }
272    
273            /**
274            * Returns the properties of this shopping order item.
275            *
276            * @return the properties of this shopping order item
277            */
278            @Override
279            public java.lang.String getProperties() {
280                    return _shoppingOrderItem.getProperties();
281            }
282    
283            /**
284            * Sets the properties of this shopping order item.
285            *
286            * @param properties the properties of this shopping order item
287            */
288            @Override
289            public void setProperties(java.lang.String properties) {
290                    _shoppingOrderItem.setProperties(properties);
291            }
292    
293            /**
294            * Returns the price of this shopping order item.
295            *
296            * @return the price of this shopping order item
297            */
298            @Override
299            public double getPrice() {
300                    return _shoppingOrderItem.getPrice();
301            }
302    
303            /**
304            * Sets the price of this shopping order item.
305            *
306            * @param price the price of this shopping order item
307            */
308            @Override
309            public void setPrice(double price) {
310                    _shoppingOrderItem.setPrice(price);
311            }
312    
313            /**
314            * Returns the quantity of this shopping order item.
315            *
316            * @return the quantity of this shopping order item
317            */
318            @Override
319            public int getQuantity() {
320                    return _shoppingOrderItem.getQuantity();
321            }
322    
323            /**
324            * Sets the quantity of this shopping order item.
325            *
326            * @param quantity the quantity of this shopping order item
327            */
328            @Override
329            public void setQuantity(int quantity) {
330                    _shoppingOrderItem.setQuantity(quantity);
331            }
332    
333            /**
334            * Returns the shipped date of this shopping order item.
335            *
336            * @return the shipped date of this shopping order item
337            */
338            @Override
339            public java.util.Date getShippedDate() {
340                    return _shoppingOrderItem.getShippedDate();
341            }
342    
343            /**
344            * Sets the shipped date of this shopping order item.
345            *
346            * @param shippedDate the shipped date of this shopping order item
347            */
348            @Override
349            public void setShippedDate(java.util.Date shippedDate) {
350                    _shoppingOrderItem.setShippedDate(shippedDate);
351            }
352    
353            @Override
354            public boolean isNew() {
355                    return _shoppingOrderItem.isNew();
356            }
357    
358            @Override
359            public void setNew(boolean n) {
360                    _shoppingOrderItem.setNew(n);
361            }
362    
363            @Override
364            public boolean isCachedModel() {
365                    return _shoppingOrderItem.isCachedModel();
366            }
367    
368            @Override
369            public void setCachedModel(boolean cachedModel) {
370                    _shoppingOrderItem.setCachedModel(cachedModel);
371            }
372    
373            @Override
374            public boolean isEscapedModel() {
375                    return _shoppingOrderItem.isEscapedModel();
376            }
377    
378            @Override
379            public java.io.Serializable getPrimaryKeyObj() {
380                    return _shoppingOrderItem.getPrimaryKeyObj();
381            }
382    
383            @Override
384            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
385                    _shoppingOrderItem.setPrimaryKeyObj(primaryKeyObj);
386            }
387    
388            @Override
389            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
390                    return _shoppingOrderItem.getExpandoBridge();
391            }
392    
393            @Override
394            public void setExpandoBridgeAttributes(
395                    com.liferay.portal.model.BaseModel<?> baseModel) {
396                    _shoppingOrderItem.setExpandoBridgeAttributes(baseModel);
397            }
398    
399            @Override
400            public void setExpandoBridgeAttributes(
401                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
402                    _shoppingOrderItem.setExpandoBridgeAttributes(expandoBridge);
403            }
404    
405            @Override
406            public void setExpandoBridgeAttributes(
407                    com.liferay.portal.service.ServiceContext serviceContext) {
408                    _shoppingOrderItem.setExpandoBridgeAttributes(serviceContext);
409            }
410    
411            @Override
412            public java.lang.Object clone() {
413                    return new ShoppingOrderItemWrapper((ShoppingOrderItem)_shoppingOrderItem.clone());
414            }
415    
416            @Override
417            public int compareTo(
418                    com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) {
419                    return _shoppingOrderItem.compareTo(shoppingOrderItem);
420            }
421    
422            @Override
423            public int hashCode() {
424                    return _shoppingOrderItem.hashCode();
425            }
426    
427            @Override
428            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingOrderItem> toCacheModel() {
429                    return _shoppingOrderItem.toCacheModel();
430            }
431    
432            @Override
433            public com.liferay.portlet.shopping.model.ShoppingOrderItem toEscapedModel() {
434                    return new ShoppingOrderItemWrapper(_shoppingOrderItem.toEscapedModel());
435            }
436    
437            @Override
438            public com.liferay.portlet.shopping.model.ShoppingOrderItem toUnescapedModel() {
439                    return new ShoppingOrderItemWrapper(_shoppingOrderItem.toUnescapedModel());
440            }
441    
442            @Override
443            public java.lang.String toString() {
444                    return _shoppingOrderItem.toString();
445            }
446    
447            @Override
448            public java.lang.String toXmlString() {
449                    return _shoppingOrderItem.toXmlString();
450            }
451    
452            @Override
453            public void persist()
454                    throws com.liferay.portal.kernel.exception.SystemException {
455                    _shoppingOrderItem.persist();
456            }
457    
458            @Override
459            public boolean equals(Object obj) {
460                    if (this == obj) {
461                            return true;
462                    }
463    
464                    if (!(obj instanceof ShoppingOrderItemWrapper)) {
465                            return false;
466                    }
467    
468                    ShoppingOrderItemWrapper shoppingOrderItemWrapper = (ShoppingOrderItemWrapper)obj;
469    
470                    if (Validator.equals(_shoppingOrderItem,
471                                            shoppingOrderItemWrapper._shoppingOrderItem)) {
472                            return true;
473                    }
474    
475                    return false;
476            }
477    
478            /**
479             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
480             */
481            public ShoppingOrderItem getWrappedShoppingOrderItem() {
482                    return _shoppingOrderItem;
483            }
484    
485            @Override
486            public ShoppingOrderItem getWrappedModel() {
487                    return _shoppingOrderItem;
488            }
489    
490            @Override
491            public void resetOriginalValues() {
492                    _shoppingOrderItem.resetOriginalValues();
493            }
494    
495            private ShoppingOrderItem _shoppingOrderItem;
496    }