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.ServiceComponent;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing ServiceComponent in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see ServiceComponent
029     * @generated
030     */
031    public class ServiceComponentCacheModel implements CacheModel<ServiceComponent>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(11);
036    
037                    sb.append("{serviceComponentId=");
038                    sb.append(serviceComponentId);
039                    sb.append(", buildNamespace=");
040                    sb.append(buildNamespace);
041                    sb.append(", buildNumber=");
042                    sb.append(buildNumber);
043                    sb.append(", buildDate=");
044                    sb.append(buildDate);
045                    sb.append(", data=");
046                    sb.append(data);
047                    sb.append("}");
048    
049                    return sb.toString();
050            }
051    
052            public ServiceComponent toEntityModel() {
053                    ServiceComponentImpl serviceComponentImpl = new ServiceComponentImpl();
054    
055                    serviceComponentImpl.setServiceComponentId(serviceComponentId);
056    
057                    if (buildNamespace == null) {
058                            serviceComponentImpl.setBuildNamespace(StringPool.BLANK);
059                    }
060                    else {
061                            serviceComponentImpl.setBuildNamespace(buildNamespace);
062                    }
063    
064                    serviceComponentImpl.setBuildNumber(buildNumber);
065                    serviceComponentImpl.setBuildDate(buildDate);
066    
067                    if (data == null) {
068                            serviceComponentImpl.setData(StringPool.BLANK);
069                    }
070                    else {
071                            serviceComponentImpl.setData(data);
072                    }
073    
074                    serviceComponentImpl.resetOriginalValues();
075    
076                    return serviceComponentImpl;
077            }
078    
079            public long serviceComponentId;
080            public String buildNamespace;
081            public long buildNumber;
082            public long buildDate;
083            public String data;
084    }