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