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