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