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.asset.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.asset.model.AssetCategory;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing AssetCategory in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see AssetCategory
032     * @generated
033     */
034    public class AssetCategoryCacheModel implements CacheModel<AssetCategory>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(31);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", categoryId=");
043                    sb.append(categoryId);
044                    sb.append(", groupId=");
045                    sb.append(groupId);
046                    sb.append(", companyId=");
047                    sb.append(companyId);
048                    sb.append(", userId=");
049                    sb.append(userId);
050                    sb.append(", userName=");
051                    sb.append(userName);
052                    sb.append(", createDate=");
053                    sb.append(createDate);
054                    sb.append(", modifiedDate=");
055                    sb.append(modifiedDate);
056                    sb.append(", parentCategoryId=");
057                    sb.append(parentCategoryId);
058                    sb.append(", leftCategoryId=");
059                    sb.append(leftCategoryId);
060                    sb.append(", rightCategoryId=");
061                    sb.append(rightCategoryId);
062                    sb.append(", name=");
063                    sb.append(name);
064                    sb.append(", title=");
065                    sb.append(title);
066                    sb.append(", description=");
067                    sb.append(description);
068                    sb.append(", vocabularyId=");
069                    sb.append(vocabularyId);
070                    sb.append("}");
071    
072                    return sb.toString();
073            }
074    
075            public AssetCategory toEntityModel() {
076                    AssetCategoryImpl assetCategoryImpl = new AssetCategoryImpl();
077    
078                    if (uuid == null) {
079                            assetCategoryImpl.setUuid(StringPool.BLANK);
080                    }
081                    else {
082                            assetCategoryImpl.setUuid(uuid);
083                    }
084    
085                    assetCategoryImpl.setCategoryId(categoryId);
086                    assetCategoryImpl.setGroupId(groupId);
087                    assetCategoryImpl.setCompanyId(companyId);
088                    assetCategoryImpl.setUserId(userId);
089    
090                    if (userName == null) {
091                            assetCategoryImpl.setUserName(StringPool.BLANK);
092                    }
093                    else {
094                            assetCategoryImpl.setUserName(userName);
095                    }
096    
097                    if (createDate == Long.MIN_VALUE) {
098                            assetCategoryImpl.setCreateDate(null);
099                    }
100                    else {
101                            assetCategoryImpl.setCreateDate(new Date(createDate));
102                    }
103    
104                    if (modifiedDate == Long.MIN_VALUE) {
105                            assetCategoryImpl.setModifiedDate(null);
106                    }
107                    else {
108                            assetCategoryImpl.setModifiedDate(new Date(modifiedDate));
109                    }
110    
111                    assetCategoryImpl.setParentCategoryId(parentCategoryId);
112                    assetCategoryImpl.setLeftCategoryId(leftCategoryId);
113                    assetCategoryImpl.setRightCategoryId(rightCategoryId);
114    
115                    if (name == null) {
116                            assetCategoryImpl.setName(StringPool.BLANK);
117                    }
118                    else {
119                            assetCategoryImpl.setName(name);
120                    }
121    
122                    if (title == null) {
123                            assetCategoryImpl.setTitle(StringPool.BLANK);
124                    }
125                    else {
126                            assetCategoryImpl.setTitle(title);
127                    }
128    
129                    if (description == null) {
130                            assetCategoryImpl.setDescription(StringPool.BLANK);
131                    }
132                    else {
133                            assetCategoryImpl.setDescription(description);
134                    }
135    
136                    assetCategoryImpl.setVocabularyId(vocabularyId);
137    
138                    assetCategoryImpl.resetOriginalValues();
139    
140                    return assetCategoryImpl;
141            }
142    
143            public String uuid;
144            public long categoryId;
145            public long groupId;
146            public long companyId;
147            public long userId;
148            public String userName;
149            public long createDate;
150            public long modifiedDate;
151            public long parentCategoryId;
152            public long leftCategoryId;
153            public long rightCategoryId;
154            public String name;
155            public String title;
156            public String description;
157            public long vocabularyId;
158    }