001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.Validator;
020    
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link ResourceAction}.
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see ResourceAction
031     * @generated
032     */
033    @ProviderType
034    public class ResourceActionWrapper implements ResourceAction,
035            ModelWrapper<ResourceAction> {
036            public ResourceActionWrapper(ResourceAction resourceAction) {
037                    _resourceAction = resourceAction;
038            }
039    
040            @Override
041            public Class<?> getModelClass() {
042                    return ResourceAction.class;
043            }
044    
045            @Override
046            public String getModelClassName() {
047                    return ResourceAction.class.getName();
048            }
049    
050            @Override
051            public Map<String, Object> getModelAttributes() {
052                    Map<String, Object> attributes = new HashMap<String, Object>();
053    
054                    attributes.put("mvccVersion", getMvccVersion());
055                    attributes.put("resourceActionId", getResourceActionId());
056                    attributes.put("name", getName());
057                    attributes.put("actionId", getActionId());
058                    attributes.put("bitwiseValue", getBitwiseValue());
059    
060                    return attributes;
061            }
062    
063            @Override
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    Long mvccVersion = (Long)attributes.get("mvccVersion");
066    
067                    if (mvccVersion != null) {
068                            setMvccVersion(mvccVersion);
069                    }
070    
071                    Long resourceActionId = (Long)attributes.get("resourceActionId");
072    
073                    if (resourceActionId != null) {
074                            setResourceActionId(resourceActionId);
075                    }
076    
077                    String name = (String)attributes.get("name");
078    
079                    if (name != null) {
080                            setName(name);
081                    }
082    
083                    String actionId = (String)attributes.get("actionId");
084    
085                    if (actionId != null) {
086                            setActionId(actionId);
087                    }
088    
089                    Long bitwiseValue = (Long)attributes.get("bitwiseValue");
090    
091                    if (bitwiseValue != null) {
092                            setBitwiseValue(bitwiseValue);
093                    }
094            }
095    
096            @Override
097            public java.lang.Object clone() {
098                    return new ResourceActionWrapper((ResourceAction)_resourceAction.clone());
099            }
100    
101            @Override
102            public int compareTo(com.liferay.portal.model.ResourceAction resourceAction) {
103                    return _resourceAction.compareTo(resourceAction);
104            }
105    
106            /**
107            * Returns the action ID of this resource action.
108            *
109            * @return the action ID of this resource action
110            */
111            @Override
112            public java.lang.String getActionId() {
113                    return _resourceAction.getActionId();
114            }
115    
116            /**
117            * Returns the bitwise value of this resource action.
118            *
119            * @return the bitwise value of this resource action
120            */
121            @Override
122            public long getBitwiseValue() {
123                    return _resourceAction.getBitwiseValue();
124            }
125    
126            @Override
127            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
128                    return _resourceAction.getExpandoBridge();
129            }
130    
131            /**
132            * Returns the mvcc version of this resource action.
133            *
134            * @return the mvcc version of this resource action
135            */
136            @Override
137            public long getMvccVersion() {
138                    return _resourceAction.getMvccVersion();
139            }
140    
141            /**
142            * Returns the name of this resource action.
143            *
144            * @return the name of this resource action
145            */
146            @Override
147            public java.lang.String getName() {
148                    return _resourceAction.getName();
149            }
150    
151            /**
152            * Returns the primary key of this resource action.
153            *
154            * @return the primary key of this resource action
155            */
156            @Override
157            public long getPrimaryKey() {
158                    return _resourceAction.getPrimaryKey();
159            }
160    
161            @Override
162            public java.io.Serializable getPrimaryKeyObj() {
163                    return _resourceAction.getPrimaryKeyObj();
164            }
165    
166            /**
167            * Returns the resource action ID of this resource action.
168            *
169            * @return the resource action ID of this resource action
170            */
171            @Override
172            public long getResourceActionId() {
173                    return _resourceAction.getResourceActionId();
174            }
175    
176            @Override
177            public int hashCode() {
178                    return _resourceAction.hashCode();
179            }
180    
181            @Override
182            public boolean isCachedModel() {
183                    return _resourceAction.isCachedModel();
184            }
185    
186            @Override
187            public boolean isEscapedModel() {
188                    return _resourceAction.isEscapedModel();
189            }
190    
191            @Override
192            public boolean isNew() {
193                    return _resourceAction.isNew();
194            }
195    
196            @Override
197            public void persist() {
198                    _resourceAction.persist();
199            }
200    
201            /**
202            * Sets the action ID of this resource action.
203            *
204            * @param actionId the action ID of this resource action
205            */
206            @Override
207            public void setActionId(java.lang.String actionId) {
208                    _resourceAction.setActionId(actionId);
209            }
210    
211            /**
212            * Sets the bitwise value of this resource action.
213            *
214            * @param bitwiseValue the bitwise value of this resource action
215            */
216            @Override
217            public void setBitwiseValue(long bitwiseValue) {
218                    _resourceAction.setBitwiseValue(bitwiseValue);
219            }
220    
221            @Override
222            public void setCachedModel(boolean cachedModel) {
223                    _resourceAction.setCachedModel(cachedModel);
224            }
225    
226            @Override
227            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
228                    _resourceAction.setExpandoBridgeAttributes(baseModel);
229            }
230    
231            @Override
232            public void setExpandoBridgeAttributes(
233                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
234                    _resourceAction.setExpandoBridgeAttributes(expandoBridge);
235            }
236    
237            @Override
238            public void setExpandoBridgeAttributes(
239                    com.liferay.portal.service.ServiceContext serviceContext) {
240                    _resourceAction.setExpandoBridgeAttributes(serviceContext);
241            }
242    
243            /**
244            * Sets the mvcc version of this resource action.
245            *
246            * @param mvccVersion the mvcc version of this resource action
247            */
248            @Override
249            public void setMvccVersion(long mvccVersion) {
250                    _resourceAction.setMvccVersion(mvccVersion);
251            }
252    
253            /**
254            * Sets the name of this resource action.
255            *
256            * @param name the name of this resource action
257            */
258            @Override
259            public void setName(java.lang.String name) {
260                    _resourceAction.setName(name);
261            }
262    
263            @Override
264            public void setNew(boolean n) {
265                    _resourceAction.setNew(n);
266            }
267    
268            /**
269            * Sets the primary key of this resource action.
270            *
271            * @param primaryKey the primary key of this resource action
272            */
273            @Override
274            public void setPrimaryKey(long primaryKey) {
275                    _resourceAction.setPrimaryKey(primaryKey);
276            }
277    
278            @Override
279            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
280                    _resourceAction.setPrimaryKeyObj(primaryKeyObj);
281            }
282    
283            /**
284            * Sets the resource action ID of this resource action.
285            *
286            * @param resourceActionId the resource action ID of this resource action
287            */
288            @Override
289            public void setResourceActionId(long resourceActionId) {
290                    _resourceAction.setResourceActionId(resourceActionId);
291            }
292    
293            @Override
294            public CacheModel<com.liferay.portal.model.ResourceAction> toCacheModel() {
295                    return _resourceAction.toCacheModel();
296            }
297    
298            @Override
299            public com.liferay.portal.model.ResourceAction toEscapedModel() {
300                    return new ResourceActionWrapper(_resourceAction.toEscapedModel());
301            }
302    
303            @Override
304            public java.lang.String toString() {
305                    return _resourceAction.toString();
306            }
307    
308            @Override
309            public com.liferay.portal.model.ResourceAction toUnescapedModel() {
310                    return new ResourceActionWrapper(_resourceAction.toUnescapedModel());
311            }
312    
313            @Override
314            public java.lang.String toXmlString() {
315                    return _resourceAction.toXmlString();
316            }
317    
318            @Override
319            public boolean equals(Object obj) {
320                    if (this == obj) {
321                            return true;
322                    }
323    
324                    if (!(obj instanceof ResourceActionWrapper)) {
325                            return false;
326                    }
327    
328                    ResourceActionWrapper resourceActionWrapper = (ResourceActionWrapper)obj;
329    
330                    if (Validator.equals(_resourceAction,
331                                            resourceActionWrapper._resourceAction)) {
332                            return true;
333                    }
334    
335                    return false;
336            }
337    
338            @Override
339            public ResourceAction getWrappedModel() {
340                    return _resourceAction;
341            }
342    
343            @Override
344            public boolean isEntityCacheEnabled() {
345                    return _resourceAction.isEntityCacheEnabled();
346            }
347    
348            @Override
349            public boolean isFinderCacheEnabled() {
350                    return _resourceAction.isFinderCacheEnabled();
351            }
352    
353            @Override
354            public void resetOriginalValues() {
355                    _resourceAction.resetOriginalValues();
356            }
357    
358            private final ResourceAction _resourceAction;
359    }