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