001    /**
002     * Copyright (c) 2000-2012 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.portal.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    import com.liferay.portal.model.Country;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing Country in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see Country
029     * @generated
030     */
031    public class CountryCacheModel implements CacheModel<Country>, Serializable {
032            @Override
033            public String toString() {
034                    StringBundler sb = new StringBundler(17);
035    
036                    sb.append("{countryId=");
037                    sb.append(countryId);
038                    sb.append(", name=");
039                    sb.append(name);
040                    sb.append(", a2=");
041                    sb.append(a2);
042                    sb.append(", a3=");
043                    sb.append(a3);
044                    sb.append(", number=");
045                    sb.append(number);
046                    sb.append(", idd=");
047                    sb.append(idd);
048                    sb.append(", zipRequired=");
049                    sb.append(zipRequired);
050                    sb.append(", active=");
051                    sb.append(active);
052                    sb.append("}");
053    
054                    return sb.toString();
055            }
056    
057            public Country toEntityModel() {
058                    CountryImpl countryImpl = new CountryImpl();
059    
060                    countryImpl.setCountryId(countryId);
061    
062                    if (name == null) {
063                            countryImpl.setName(StringPool.BLANK);
064                    }
065                    else {
066                            countryImpl.setName(name);
067                    }
068    
069                    if (a2 == null) {
070                            countryImpl.setA2(StringPool.BLANK);
071                    }
072                    else {
073                            countryImpl.setA2(a2);
074                    }
075    
076                    if (a3 == null) {
077                            countryImpl.setA3(StringPool.BLANK);
078                    }
079                    else {
080                            countryImpl.setA3(a3);
081                    }
082    
083                    if (number == null) {
084                            countryImpl.setNumber(StringPool.BLANK);
085                    }
086                    else {
087                            countryImpl.setNumber(number);
088                    }
089    
090                    if (idd == null) {
091                            countryImpl.setIdd(StringPool.BLANK);
092                    }
093                    else {
094                            countryImpl.setIdd(idd);
095                    }
096    
097                    countryImpl.setZipRequired(zipRequired);
098                    countryImpl.setActive(active);
099    
100                    countryImpl.resetOriginalValues();
101    
102                    return countryImpl;
103            }
104    
105            public long countryId;
106            public String name;
107            public String a2;
108            public String a3;
109            public String number;
110            public String idd;
111            public boolean zipRequired;
112            public boolean active;
113    }