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