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.ResourceAction;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing ResourceAction in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see ResourceAction
029     * @generated
030     */
031    public class ResourceActionCacheModel implements CacheModel<ResourceAction>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(9);
036    
037                    sb.append("{resourceActionId=");
038                    sb.append(resourceActionId);
039                    sb.append(", name=");
040                    sb.append(name);
041                    sb.append(", actionId=");
042                    sb.append(actionId);
043                    sb.append(", bitwiseValue=");
044                    sb.append(bitwiseValue);
045                    sb.append("}");
046    
047                    return sb.toString();
048            }
049    
050            public ResourceAction toEntityModel() {
051                    ResourceActionImpl resourceActionImpl = new ResourceActionImpl();
052    
053                    resourceActionImpl.setResourceActionId(resourceActionId);
054    
055                    if (name == null) {
056                            resourceActionImpl.setName(StringPool.BLANK);
057                    }
058                    else {
059                            resourceActionImpl.setName(name);
060                    }
061    
062                    if (actionId == null) {
063                            resourceActionImpl.setActionId(StringPool.BLANK);
064                    }
065                    else {
066                            resourceActionImpl.setActionId(actionId);
067                    }
068    
069                    resourceActionImpl.setBitwiseValue(bitwiseValue);
070    
071                    resourceActionImpl.resetOriginalValues();
072    
073                    return resourceActionImpl;
074            }
075    
076            public long resourceActionId;
077            public String name;
078            public String actionId;
079            public long bitwiseValue;
080    }