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