001    /**
002     * Copyright (c) 2000-present 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            @Override
134            public java.lang.Object clone() {
135                    return new ShoppingOrderItemWrapper((ShoppingOrderItem)_shoppingOrderItem.clone());
136            }
137    
138            @Override
139            public int compareTo(
140                    com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) {
141                    return _shoppingOrderItem.compareTo(shoppingOrderItem);
142            }
143    
144            /**
145            * Returns the description of this shopping order item.
146            *
147            * @return the description of this shopping order item
148            */
149            @Override
150            public java.lang.String getDescription() {
151                    return _shoppingOrderItem.getDescription();
152            }
153    
154            @Override
155            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
156                    return _shoppingOrderItem.getExpandoBridge();
157            }
158    
159            /**
160            * Returns the item ID of this shopping order item.
161            *
162            * @return the item ID of this shopping order item
163            */
164            @Override
165            public java.lang.String getItemId() {
166                    return _shoppingOrderItem.getItemId();
167            }
168    
169            /**
170            * Returns the name of this shopping order item.
171            *
172            * @return the name of this shopping order item
173            */
174            @Override
175            public java.lang.String getName() {
176                    return _shoppingOrderItem.getName();
177            }
178    
179            /**
180            * Returns the order ID of this shopping order item.
181            *
182            * @return the order ID of this shopping order item
183            */
184            @Override
185            public long getOrderId() {
186                    return _shoppingOrderItem.getOrderId();
187            }
188    
189            /**
190            * Returns the order item ID of this shopping order item.
191            *
192            * @return the order item ID of this shopping order item
193            */
194            @Override
195            public long getOrderItemId() {
196                    return _shoppingOrderItem.getOrderItemId();
197            }
198    
199            /**
200            * Returns the price of this shopping order item.
201            *
202            * @return the price of this shopping order item
203            */
204            @Override
205            public double getPrice() {
206                    return _shoppingOrderItem.getPrice();
207            }
208    
209            /**
210            * Returns the primary key of this shopping order item.
211            *
212            * @return the primary key of this shopping order item
213            */
214            @Override
215            public long getPrimaryKey() {
216                    return _shoppingOrderItem.getPrimaryKey();
217            }
218    
219            @Override
220            public java.io.Serializable getPrimaryKeyObj() {
221                    return _shoppingOrderItem.getPrimaryKeyObj();
222            }
223    
224            /**
225            * Returns the properties of this shopping order item.
226            *
227            * @return the properties of this shopping order item
228            */
229            @Override
230            public java.lang.String getProperties() {
231                    return _shoppingOrderItem.getProperties();
232            }
233    
234            /**
235            * Returns the quantity of this shopping order item.
236            *
237            * @return the quantity of this shopping order item
238            */
239            @Override
240            public int getQuantity() {
241                    return _shoppingOrderItem.getQuantity();
242            }
243    
244            /**
245            * Returns the shipped date of this shopping order item.
246            *
247            * @return the shipped date of this shopping order item
248            */
249            @Override
250            public Date getShippedDate() {
251                    return _shoppingOrderItem.getShippedDate();
252            }
253    
254            /**
255            * Returns the sku of this shopping order item.
256            *
257            * @return the sku of this shopping order item
258            */
259            @Override
260            public java.lang.String getSku() {
261                    return _shoppingOrderItem.getSku();
262            }
263    
264            @Override
265            public int hashCode() {
266                    return _shoppingOrderItem.hashCode();
267            }
268    
269            @Override
270            public boolean isCachedModel() {
271                    return _shoppingOrderItem.isCachedModel();
272            }
273    
274            @Override
275            public boolean isEscapedModel() {
276                    return _shoppingOrderItem.isEscapedModel();
277            }
278    
279            @Override
280            public boolean isNew() {
281                    return _shoppingOrderItem.isNew();
282            }
283    
284            @Override
285            public void persist() {
286                    _shoppingOrderItem.persist();
287            }
288    
289            @Override
290            public void setCachedModel(boolean cachedModel) {
291                    _shoppingOrderItem.setCachedModel(cachedModel);
292            }
293    
294            /**
295            * Sets the description of this shopping order item.
296            *
297            * @param description the description of this shopping order item
298            */
299            @Override
300            public void setDescription(java.lang.String description) {
301                    _shoppingOrderItem.setDescription(description);
302            }
303    
304            @Override
305            public void setExpandoBridgeAttributes(
306                    com.liferay.portal.model.BaseModel<?> baseModel) {
307                    _shoppingOrderItem.setExpandoBridgeAttributes(baseModel);
308            }
309    
310            @Override
311            public void setExpandoBridgeAttributes(
312                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
313                    _shoppingOrderItem.setExpandoBridgeAttributes(expandoBridge);
314            }
315    
316            @Override
317            public void setExpandoBridgeAttributes(
318                    com.liferay.portal.service.ServiceContext serviceContext) {
319                    _shoppingOrderItem.setExpandoBridgeAttributes(serviceContext);
320            }
321    
322            /**
323            * Sets the item ID of this shopping order item.
324            *
325            * @param itemId the item ID of this shopping order item
326            */
327            @Override
328            public void setItemId(java.lang.String itemId) {
329                    _shoppingOrderItem.setItemId(itemId);
330            }
331    
332            /**
333            * Sets the name of this shopping order item.
334            *
335            * @param name the name of this shopping order item
336            */
337            @Override
338            public void setName(java.lang.String name) {
339                    _shoppingOrderItem.setName(name);
340            }
341    
342            @Override
343            public void setNew(boolean n) {
344                    _shoppingOrderItem.setNew(n);
345            }
346    
347            /**
348            * Sets the order ID of this shopping order item.
349            *
350            * @param orderId the order ID of this shopping order item
351            */
352            @Override
353            public void setOrderId(long orderId) {
354                    _shoppingOrderItem.setOrderId(orderId);
355            }
356    
357            /**
358            * Sets the order item ID of this shopping order item.
359            *
360            * @param orderItemId the order item ID of this shopping order item
361            */
362            @Override
363            public void setOrderItemId(long orderItemId) {
364                    _shoppingOrderItem.setOrderItemId(orderItemId);
365            }
366    
367            /**
368            * Sets the price of this shopping order item.
369            *
370            * @param price the price of this shopping order item
371            */
372            @Override
373            public void setPrice(double price) {
374                    _shoppingOrderItem.setPrice(price);
375            }
376    
377            /**
378            * Sets the primary key of this shopping order item.
379            *
380            * @param primaryKey the primary key of this shopping order item
381            */
382            @Override
383            public void setPrimaryKey(long primaryKey) {
384                    _shoppingOrderItem.setPrimaryKey(primaryKey);
385            }
386    
387            @Override
388            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
389                    _shoppingOrderItem.setPrimaryKeyObj(primaryKeyObj);
390            }
391    
392            /**
393            * Sets the properties of this shopping order item.
394            *
395            * @param properties the properties of this shopping order item
396            */
397            @Override
398            public void setProperties(java.lang.String properties) {
399                    _shoppingOrderItem.setProperties(properties);
400            }
401    
402            /**
403            * Sets the quantity of this shopping order item.
404            *
405            * @param quantity the quantity of this shopping order item
406            */
407            @Override
408            public void setQuantity(int quantity) {
409                    _shoppingOrderItem.setQuantity(quantity);
410            }
411    
412            /**
413            * Sets the shipped date of this shopping order item.
414            *
415            * @param shippedDate the shipped date of this shopping order item
416            */
417            @Override
418            public void setShippedDate(Date shippedDate) {
419                    _shoppingOrderItem.setShippedDate(shippedDate);
420            }
421    
422            /**
423            * Sets the sku of this shopping order item.
424            *
425            * @param sku the sku of this shopping order item
426            */
427            @Override
428            public void setSku(java.lang.String sku) {
429                    _shoppingOrderItem.setSku(sku);
430            }
431    
432            @Override
433            public com.liferay.portal.model.CacheModel<com.liferay.portlet.shopping.model.ShoppingOrderItem> toCacheModel() {
434                    return _shoppingOrderItem.toCacheModel();
435            }
436    
437            @Override
438            public com.liferay.portlet.shopping.model.ShoppingOrderItem toEscapedModel() {
439                    return new ShoppingOrderItemWrapper(_shoppingOrderItem.toEscapedModel());
440            }
441    
442            @Override
443            public java.lang.String toString() {
444                    return _shoppingOrderItem.toString();
445            }
446    
447            @Override
448            public com.liferay.portlet.shopping.model.ShoppingOrderItem toUnescapedModel() {
449                    return new ShoppingOrderItemWrapper(_shoppingOrderItem.toUnescapedModel());
450            }
451    
452            @Override
453            public java.lang.String toXmlString() {
454                    return _shoppingOrderItem.toXmlString();
455            }
456    
457            @Override
458            public boolean equals(Object obj) {
459                    if (this == obj) {
460                            return true;
461                    }
462    
463                    if (!(obj instanceof ShoppingOrderItemWrapper)) {
464                            return false;
465                    }
466    
467                    ShoppingOrderItemWrapper shoppingOrderItemWrapper = (ShoppingOrderItemWrapper)obj;
468    
469                    if (Validator.equals(_shoppingOrderItem,
470                                            shoppingOrderItemWrapper._shoppingOrderItem)) {
471                            return true;
472                    }
473    
474                    return false;
475            }
476    
477            /**
478             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
479             */
480            @Deprecated
481            public ShoppingOrderItem getWrappedShoppingOrderItem() {
482                    return _shoppingOrderItem;
483            }
484    
485            @Override
486            public ShoppingOrderItem getWrappedModel() {
487                    return _shoppingOrderItem;
488            }
489    
490            @Override
491            public boolean isEntityCacheEnabled() {
492                    return _shoppingOrderItem.isEntityCacheEnabled();
493            }
494    
495            @Override
496            public boolean isFinderCacheEnabled() {
497                    return _shoppingOrderItem.isFinderCacheEnabled();
498            }
499    
500            @Override
501            public void resetOriginalValues() {
502                    _shoppingOrderItem.resetOriginalValues();
503            }
504    
505            private final ShoppingOrderItem _shoppingOrderItem;
506    }