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