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