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