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.journal.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.journal.model.JournalArticleResource;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing JournalArticleResource in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see JournalArticleResource
030     * @generated
031     */
032    public class JournalArticleResourceCacheModel implements CacheModel<JournalArticleResource>,
033            Serializable {
034            @Override
035            public String toString() {
036                    StringBundler sb = new StringBundler(9);
037    
038                    sb.append("{uuid=");
039                    sb.append(uuid);
040                    sb.append(", resourcePrimKey=");
041                    sb.append(resourcePrimKey);
042                    sb.append(", groupId=");
043                    sb.append(groupId);
044                    sb.append(", articleId=");
045                    sb.append(articleId);
046                    sb.append("}");
047    
048                    return sb.toString();
049            }
050    
051            public JournalArticleResource toEntityModel() {
052                    JournalArticleResourceImpl journalArticleResourceImpl = new JournalArticleResourceImpl();
053    
054                    if (uuid == null) {
055                            journalArticleResourceImpl.setUuid(StringPool.BLANK);
056                    }
057                    else {
058                            journalArticleResourceImpl.setUuid(uuid);
059                    }
060    
061                    journalArticleResourceImpl.setResourcePrimKey(resourcePrimKey);
062                    journalArticleResourceImpl.setGroupId(groupId);
063    
064                    if (articleId == null) {
065                            journalArticleResourceImpl.setArticleId(StringPool.BLANK);
066                    }
067                    else {
068                            journalArticleResourceImpl.setArticleId(articleId);
069                    }
070    
071                    journalArticleResourceImpl.resetOriginalValues();
072    
073                    return journalArticleResourceImpl;
074            }
075    
076            public String uuid;
077            public long resourcePrimKey;
078            public long groupId;
079            public String articleId;
080    }