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