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.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    
021    import com.liferay.portlet.shopping.model.ShoppingItemField;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing ShoppingItemField in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see ShoppingItemField
030     * @generated
031     */
032    public class ShoppingItemFieldCacheModel implements CacheModel<ShoppingItemField>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(11);
037    
038                    sb.append("{itemFieldId=");
039                    sb.append(itemFieldId);
040                    sb.append(", itemId=");
041                    sb.append(itemId);
042                    sb.append(", name=");
043                    sb.append(name);
044                    sb.append(", values=");
045                    sb.append(values);
046                    sb.append(", description=");
047                    sb.append(description);
048                    sb.append("}");
049    
050                    return sb.toString();
051            }
052    
053            public ShoppingItemField toEntityModel() {
054                    ShoppingItemFieldImpl shoppingItemFieldImpl = new ShoppingItemFieldImpl();
055    
056                    shoppingItemFieldImpl.setItemFieldId(itemFieldId);
057                    shoppingItemFieldImpl.setItemId(itemId);
058    
059                    if (name == null) {
060                            shoppingItemFieldImpl.setName(StringPool.BLANK);
061                    }
062                    else {
063                            shoppingItemFieldImpl.setName(name);
064                    }
065    
066                    if (values == null) {
067                            shoppingItemFieldImpl.setValues(StringPool.BLANK);
068                    }
069                    else {
070                            shoppingItemFieldImpl.setValues(values);
071                    }
072    
073                    if (description == null) {
074                            shoppingItemFieldImpl.setDescription(StringPool.BLANK);
075                    }
076                    else {
077                            shoppingItemFieldImpl.setDescription(description);
078                    }
079    
080                    shoppingItemFieldImpl.resetOriginalValues();
081    
082                    return shoppingItemFieldImpl;
083            }
084    
085            public long itemFieldId;
086            public long itemId;
087            public String name;
088            public String values;
089            public String description;
090    }