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.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.model.CacheModel;
019    
020    import com.liferay.portlet.shopping.model.ShoppingItemPrice;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing ShoppingItemPrice in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see ShoppingItemPrice
029     * @generated
030     */
031    public class ShoppingItemPriceCacheModel implements CacheModel<ShoppingItemPrice>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(21);
036    
037                    sb.append("{itemPriceId=");
038                    sb.append(itemPriceId);
039                    sb.append(", itemId=");
040                    sb.append(itemId);
041                    sb.append(", minQuantity=");
042                    sb.append(minQuantity);
043                    sb.append(", maxQuantity=");
044                    sb.append(maxQuantity);
045                    sb.append(", price=");
046                    sb.append(price);
047                    sb.append(", discount=");
048                    sb.append(discount);
049                    sb.append(", taxable=");
050                    sb.append(taxable);
051                    sb.append(", shipping=");
052                    sb.append(shipping);
053                    sb.append(", useShippingFormula=");
054                    sb.append(useShippingFormula);
055                    sb.append(", status=");
056                    sb.append(status);
057                    sb.append("}");
058    
059                    return sb.toString();
060            }
061    
062            public ShoppingItemPrice toEntityModel() {
063                    ShoppingItemPriceImpl shoppingItemPriceImpl = new ShoppingItemPriceImpl();
064    
065                    shoppingItemPriceImpl.setItemPriceId(itemPriceId);
066                    shoppingItemPriceImpl.setItemId(itemId);
067                    shoppingItemPriceImpl.setMinQuantity(minQuantity);
068                    shoppingItemPriceImpl.setMaxQuantity(maxQuantity);
069                    shoppingItemPriceImpl.setPrice(price);
070                    shoppingItemPriceImpl.setDiscount(discount);
071                    shoppingItemPriceImpl.setTaxable(taxable);
072                    shoppingItemPriceImpl.setShipping(shipping);
073                    shoppingItemPriceImpl.setUseShippingFormula(useShippingFormula);
074                    shoppingItemPriceImpl.setStatus(status);
075    
076                    shoppingItemPriceImpl.resetOriginalValues();
077    
078                    return shoppingItemPriceImpl;
079            }
080    
081            public long itemPriceId;
082            public long itemId;
083            public int minQuantity;
084            public int maxQuantity;
085            public double price;
086            public double discount;
087            public boolean taxable;
088            public double shipping;
089            public boolean useShippingFormula;
090            public int status;
091    }