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.documentlibrary.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.documentlibrary.model.DLFileEntryType;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing DLFileEntryType in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLFileEntryType
032     * @generated
033     */
034    public class DLFileEntryTypeCacheModel implements CacheModel<DLFileEntryType>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(21);
039    
040                    sb.append("{uuid=");
041                    sb.append(uuid);
042                    sb.append(", fileEntryTypeId=");
043                    sb.append(fileEntryTypeId);
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(", name=");
057                    sb.append(name);
058                    sb.append(", description=");
059                    sb.append(description);
060                    sb.append("}");
061    
062                    return sb.toString();
063            }
064    
065            public DLFileEntryType toEntityModel() {
066                    DLFileEntryTypeImpl dlFileEntryTypeImpl = new DLFileEntryTypeImpl();
067    
068                    if (uuid == null) {
069                            dlFileEntryTypeImpl.setUuid(StringPool.BLANK);
070                    }
071                    else {
072                            dlFileEntryTypeImpl.setUuid(uuid);
073                    }
074    
075                    dlFileEntryTypeImpl.setFileEntryTypeId(fileEntryTypeId);
076                    dlFileEntryTypeImpl.setGroupId(groupId);
077                    dlFileEntryTypeImpl.setCompanyId(companyId);
078                    dlFileEntryTypeImpl.setUserId(userId);
079    
080                    if (userName == null) {
081                            dlFileEntryTypeImpl.setUserName(StringPool.BLANK);
082                    }
083                    else {
084                            dlFileEntryTypeImpl.setUserName(userName);
085                    }
086    
087                    if (createDate == Long.MIN_VALUE) {
088                            dlFileEntryTypeImpl.setCreateDate(null);
089                    }
090                    else {
091                            dlFileEntryTypeImpl.setCreateDate(new Date(createDate));
092                    }
093    
094                    if (modifiedDate == Long.MIN_VALUE) {
095                            dlFileEntryTypeImpl.setModifiedDate(null);
096                    }
097                    else {
098                            dlFileEntryTypeImpl.setModifiedDate(new Date(modifiedDate));
099                    }
100    
101                    if (name == null) {
102                            dlFileEntryTypeImpl.setName(StringPool.BLANK);
103                    }
104                    else {
105                            dlFileEntryTypeImpl.setName(name);
106                    }
107    
108                    if (description == null) {
109                            dlFileEntryTypeImpl.setDescription(StringPool.BLANK);
110                    }
111                    else {
112                            dlFileEntryTypeImpl.setDescription(description);
113                    }
114    
115                    dlFileEntryTypeImpl.resetOriginalValues();
116    
117                    return dlFileEntryTypeImpl;
118            }
119    
120            public String uuid;
121            public long fileEntryTypeId;
122            public long groupId;
123            public long companyId;
124            public long userId;
125            public String userName;
126            public long createDate;
127            public long modifiedDate;
128            public String name;
129            public String description;
130    }