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.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.Resource;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing Resource in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see Resource
029     * @generated
030     */
031    public class ResourceCacheModel implements CacheModel<Resource>, Serializable {
032            @Override
033            public String toString() {
034                    StringBundler sb = new StringBundler(7);
035    
036                    sb.append("{resourceId=");
037                    sb.append(resourceId);
038                    sb.append(", codeId=");
039                    sb.append(codeId);
040                    sb.append(", primKey=");
041                    sb.append(primKey);
042                    sb.append("}");
043    
044                    return sb.toString();
045            }
046    
047            public Resource toEntityModel() {
048                    ResourceImpl resourceImpl = new ResourceImpl();
049    
050                    resourceImpl.setResourceId(resourceId);
051                    resourceImpl.setCodeId(codeId);
052    
053                    if (primKey == null) {
054                            resourceImpl.setPrimKey(StringPool.BLANK);
055                    }
056                    else {
057                            resourceImpl.setPrimKey(primKey);
058                    }
059    
060                    resourceImpl.resetOriginalValues();
061    
062                    return resourceImpl;
063            }
064    
065            public long resourceId;
066            public long codeId;
067            public String primKey;
068    }