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;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link ResourceAction}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       ResourceAction
029     * @generated
030     */
031    public class ResourceActionWrapper implements ResourceAction,
032            ModelWrapper<ResourceAction> {
033            public ResourceActionWrapper(ResourceAction resourceAction) {
034                    _resourceAction = resourceAction;
035            }
036    
037            public Class<?> getModelClass() {
038                    return ResourceAction.class;
039            }
040    
041            public String getModelClassName() {
042                    return ResourceAction.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("resourceActionId", getResourceActionId());
049                    attributes.put("name", getName());
050                    attributes.put("actionId", getActionId());
051                    attributes.put("bitwiseValue", getBitwiseValue());
052    
053                    return attributes;
054            }
055    
056            public void setModelAttributes(Map<String, Object> attributes) {
057                    Long resourceActionId = (Long)attributes.get("resourceActionId");
058    
059                    if (resourceActionId != null) {
060                            setResourceActionId(resourceActionId);
061                    }
062    
063                    String name = (String)attributes.get("name");
064    
065                    if (name != null) {
066                            setName(name);
067                    }
068    
069                    String actionId = (String)attributes.get("actionId");
070    
071                    if (actionId != null) {
072                            setActionId(actionId);
073                    }
074    
075                    Long bitwiseValue = (Long)attributes.get("bitwiseValue");
076    
077                    if (bitwiseValue != null) {
078                            setBitwiseValue(bitwiseValue);
079                    }
080            }
081    
082            /**
083            * Returns the primary key of this resource action.
084            *
085            * @return the primary key of this resource action
086            */
087            public long getPrimaryKey() {
088                    return _resourceAction.getPrimaryKey();
089            }
090    
091            /**
092            * Sets the primary key of this resource action.
093            *
094            * @param primaryKey the primary key of this resource action
095            */
096            public void setPrimaryKey(long primaryKey) {
097                    _resourceAction.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the resource action ID of this resource action.
102            *
103            * @return the resource action ID of this resource action
104            */
105            public long getResourceActionId() {
106                    return _resourceAction.getResourceActionId();
107            }
108    
109            /**
110            * Sets the resource action ID of this resource action.
111            *
112            * @param resourceActionId the resource action ID of this resource action
113            */
114            public void setResourceActionId(long resourceActionId) {
115                    _resourceAction.setResourceActionId(resourceActionId);
116            }
117    
118            /**
119            * Returns the name of this resource action.
120            *
121            * @return the name of this resource action
122            */
123            public java.lang.String getName() {
124                    return _resourceAction.getName();
125            }
126    
127            /**
128            * Sets the name of this resource action.
129            *
130            * @param name the name of this resource action
131            */
132            public void setName(java.lang.String name) {
133                    _resourceAction.setName(name);
134            }
135    
136            /**
137            * Returns the action ID of this resource action.
138            *
139            * @return the action ID of this resource action
140            */
141            public java.lang.String getActionId() {
142                    return _resourceAction.getActionId();
143            }
144    
145            /**
146            * Sets the action ID of this resource action.
147            *
148            * @param actionId the action ID of this resource action
149            */
150            public void setActionId(java.lang.String actionId) {
151                    _resourceAction.setActionId(actionId);
152            }
153    
154            /**
155            * Returns the bitwise value of this resource action.
156            *
157            * @return the bitwise value of this resource action
158            */
159            public long getBitwiseValue() {
160                    return _resourceAction.getBitwiseValue();
161            }
162    
163            /**
164            * Sets the bitwise value of this resource action.
165            *
166            * @param bitwiseValue the bitwise value of this resource action
167            */
168            public void setBitwiseValue(long bitwiseValue) {
169                    _resourceAction.setBitwiseValue(bitwiseValue);
170            }
171    
172            public boolean isNew() {
173                    return _resourceAction.isNew();
174            }
175    
176            public void setNew(boolean n) {
177                    _resourceAction.setNew(n);
178            }
179    
180            public boolean isCachedModel() {
181                    return _resourceAction.isCachedModel();
182            }
183    
184            public void setCachedModel(boolean cachedModel) {
185                    _resourceAction.setCachedModel(cachedModel);
186            }
187    
188            public boolean isEscapedModel() {
189                    return _resourceAction.isEscapedModel();
190            }
191    
192            public java.io.Serializable getPrimaryKeyObj() {
193                    return _resourceAction.getPrimaryKeyObj();
194            }
195    
196            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
197                    _resourceAction.setPrimaryKeyObj(primaryKeyObj);
198            }
199    
200            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
201                    return _resourceAction.getExpandoBridge();
202            }
203    
204            public void setExpandoBridgeAttributes(
205                    com.liferay.portal.service.ServiceContext serviceContext) {
206                    _resourceAction.setExpandoBridgeAttributes(serviceContext);
207            }
208    
209            @Override
210            public java.lang.Object clone() {
211                    return new ResourceActionWrapper((ResourceAction)_resourceAction.clone());
212            }
213    
214            public int compareTo(com.liferay.portal.model.ResourceAction resourceAction) {
215                    return _resourceAction.compareTo(resourceAction);
216            }
217    
218            @Override
219            public int hashCode() {
220                    return _resourceAction.hashCode();
221            }
222    
223            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceAction> toCacheModel() {
224                    return _resourceAction.toCacheModel();
225            }
226    
227            public com.liferay.portal.model.ResourceAction toEscapedModel() {
228                    return new ResourceActionWrapper(_resourceAction.toEscapedModel());
229            }
230    
231            public com.liferay.portal.model.ResourceAction toUnescapedModel() {
232                    return new ResourceActionWrapper(_resourceAction.toUnescapedModel());
233            }
234    
235            @Override
236            public java.lang.String toString() {
237                    return _resourceAction.toString();
238            }
239    
240            public java.lang.String toXmlString() {
241                    return _resourceAction.toXmlString();
242            }
243    
244            public void persist()
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    _resourceAction.persist();
247            }
248    
249            @Override
250            public boolean equals(Object obj) {
251                    if (this == obj) {
252                            return true;
253                    }
254    
255                    if (!(obj instanceof ResourceActionWrapper)) {
256                            return false;
257                    }
258    
259                    ResourceActionWrapper resourceActionWrapper = (ResourceActionWrapper)obj;
260    
261                    if (Validator.equals(_resourceAction,
262                                            resourceActionWrapper._resourceAction)) {
263                            return true;
264                    }
265    
266                    return false;
267            }
268    
269            /**
270             * @deprecated Renamed to {@link #getWrappedModel}
271             */
272            public ResourceAction getWrappedResourceAction() {
273                    return _resourceAction;
274            }
275    
276            public ResourceAction getWrappedModel() {
277                    return _resourceAction;
278            }
279    
280            public void resetOriginalValues() {
281                    _resourceAction.resetOriginalValues();
282            }
283    
284            private ResourceAction _resourceAction;
285    }