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.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.VirtualHost;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing VirtualHost in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see VirtualHost
029     * @generated
030     */
031    public class VirtualHostCacheModel implements CacheModel<VirtualHost>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(9);
036    
037                    sb.append("{virtualHostId=");
038                    sb.append(virtualHostId);
039                    sb.append(", companyId=");
040                    sb.append(companyId);
041                    sb.append(", layoutSetId=");
042                    sb.append(layoutSetId);
043                    sb.append(", hostname=");
044                    sb.append(hostname);
045                    sb.append("}");
046    
047                    return sb.toString();
048            }
049    
050            public VirtualHost toEntityModel() {
051                    VirtualHostImpl virtualHostImpl = new VirtualHostImpl();
052    
053                    virtualHostImpl.setVirtualHostId(virtualHostId);
054                    virtualHostImpl.setCompanyId(companyId);
055                    virtualHostImpl.setLayoutSetId(layoutSetId);
056    
057                    if (hostname == null) {
058                            virtualHostImpl.setHostname(StringPool.BLANK);
059                    }
060                    else {
061                            virtualHostImpl.setHostname(hostname);
062                    }
063    
064                    virtualHostImpl.resetOriginalValues();
065    
066                    return virtualHostImpl;
067            }
068    
069            public long virtualHostId;
070            public long companyId;
071            public long layoutSetId;
072            public String hostname;
073    }