001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.wiki.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.wiki.model.WikiPageResource;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing WikiPageResource in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see WikiPageResource
030     * @generated
031     */
032    public class WikiPageResourceCacheModel implements CacheModel<WikiPageResource>,
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(", nodeId=");
043                    sb.append(nodeId);
044                    sb.append(", title=");
045                    sb.append(title);
046                    sb.append("}");
047    
048                    return sb.toString();
049            }
050    
051            public WikiPageResource toEntityModel() {
052                    WikiPageResourceImpl wikiPageResourceImpl = new WikiPageResourceImpl();
053    
054                    if (uuid == null) {
055                            wikiPageResourceImpl.setUuid(StringPool.BLANK);
056                    }
057                    else {
058                            wikiPageResourceImpl.setUuid(uuid);
059                    }
060    
061                    wikiPageResourceImpl.setResourcePrimKey(resourcePrimKey);
062                    wikiPageResourceImpl.setNodeId(nodeId);
063    
064                    if (title == null) {
065                            wikiPageResourceImpl.setTitle(StringPool.BLANK);
066                    }
067                    else {
068                            wikiPageResourceImpl.setTitle(title);
069                    }
070    
071                    wikiPageResourceImpl.resetOriginalValues();
072    
073                    return wikiPageResourceImpl;
074            }
075    
076            public String uuid;
077            public long resourcePrimKey;
078            public long nodeId;
079            public String title;
080    }