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.mobiledevicerules.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.mobiledevicerules.model.MDRRuleGroup;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing MDRRuleGroup in entity cache.
029     *
030     * @author Edward C. Han
031     * @see MDRRuleGroup
032     * @generated
033     */
034    public class MDRRuleGroupCacheModel implements CacheModel<MDRRuleGroup>,
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(", ruleGroupId=");
043                    sb.append(ruleGroupId);
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 MDRRuleGroup toEntityModel() {
066                    MDRRuleGroupImpl mdrRuleGroupImpl = new MDRRuleGroupImpl();
067    
068                    if (uuid == null) {
069                            mdrRuleGroupImpl.setUuid(StringPool.BLANK);
070                    }
071                    else {
072                            mdrRuleGroupImpl.setUuid(uuid);
073                    }
074    
075                    mdrRuleGroupImpl.setRuleGroupId(ruleGroupId);
076                    mdrRuleGroupImpl.setGroupId(groupId);
077                    mdrRuleGroupImpl.setCompanyId(companyId);
078                    mdrRuleGroupImpl.setUserId(userId);
079    
080                    if (userName == null) {
081                            mdrRuleGroupImpl.setUserName(StringPool.BLANK);
082                    }
083                    else {
084                            mdrRuleGroupImpl.setUserName(userName);
085                    }
086    
087                    if (createDate == Long.MIN_VALUE) {
088                            mdrRuleGroupImpl.setCreateDate(null);
089                    }
090                    else {
091                            mdrRuleGroupImpl.setCreateDate(new Date(createDate));
092                    }
093    
094                    if (modifiedDate == Long.MIN_VALUE) {
095                            mdrRuleGroupImpl.setModifiedDate(null);
096                    }
097                    else {
098                            mdrRuleGroupImpl.setModifiedDate(new Date(modifiedDate));
099                    }
100    
101                    if (name == null) {
102                            mdrRuleGroupImpl.setName(StringPool.BLANK);
103                    }
104                    else {
105                            mdrRuleGroupImpl.setName(name);
106                    }
107    
108                    if (description == null) {
109                            mdrRuleGroupImpl.setDescription(StringPool.BLANK);
110                    }
111                    else {
112                            mdrRuleGroupImpl.setDescription(description);
113                    }
114    
115                    mdrRuleGroupImpl.resetOriginalValues();
116    
117                    return mdrRuleGroupImpl;
118            }
119    
120            public String uuid;
121            public long ruleGroupId;
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    }