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(
228                    com.liferay.portal.model.BaseModel<?> baseModel) {
229                    _resourceAction.setExpandoBridgeAttributes(baseModel);
230            }
231    
232            @Override
233            public void setExpandoBridgeAttributes(
234                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
235                    _resourceAction.setExpandoBridgeAttributes(expandoBridge);
236            }
237    
238            @Override
239            public void setExpandoBridgeAttributes(
240                    com.liferay.portal.service.ServiceContext serviceContext) {
241                    _resourceAction.setExpandoBridgeAttributes(serviceContext);
242            }
243    
244            /**
245            * Sets the mvcc version of this resource action.
246            *
247            * @param mvccVersion the mvcc version of this resource action
248            */
249            @Override
250            public void setMvccVersion(long mvccVersion) {
251                    _resourceAction.setMvccVersion(mvccVersion);
252            }
253    
254            /**
255            * Sets the name of this resource action.
256            *
257            * @param name the name of this resource action
258            */
259            @Override
260            public void setName(java.lang.String name) {
261                    _resourceAction.setName(name);
262            }
263    
264            @Override
265            public void setNew(boolean n) {
266                    _resourceAction.setNew(n);
267            }
268    
269            /**
270            * Sets the primary key of this resource action.
271            *
272            * @param primaryKey the primary key of this resource action
273            */
274            @Override
275            public void setPrimaryKey(long primaryKey) {
276                    _resourceAction.setPrimaryKey(primaryKey);
277            }
278    
279            @Override
280            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
281                    _resourceAction.setPrimaryKeyObj(primaryKeyObj);
282            }
283    
284            /**
285            * Sets the resource action ID of this resource action.
286            *
287            * @param resourceActionId the resource action ID of this resource action
288            */
289            @Override
290            public void setResourceActionId(long resourceActionId) {
291                    _resourceAction.setResourceActionId(resourceActionId);
292            }
293    
294            @Override
295            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceAction> toCacheModel() {
296                    return _resourceAction.toCacheModel();
297            }
298    
299            @Override
300            public com.liferay.portal.model.ResourceAction toEscapedModel() {
301                    return new ResourceActionWrapper(_resourceAction.toEscapedModel());
302            }
303    
304            @Override
305            public java.lang.String toString() {
306                    return _resourceAction.toString();
307            }
308    
309            @Override
310            public com.liferay.portal.model.ResourceAction toUnescapedModel() {
311                    return new ResourceActionWrapper(_resourceAction.toUnescapedModel());
312            }
313    
314            @Override
315            public java.lang.String toXmlString() {
316                    return _resourceAction.toXmlString();
317            }
318    
319            @Override
320            public boolean equals(Object obj) {
321                    if (this == obj) {
322                            return true;
323                    }
324    
325                    if (!(obj instanceof ResourceActionWrapper)) {
326                            return false;
327                    }
328    
329                    ResourceActionWrapper resourceActionWrapper = (ResourceActionWrapper)obj;
330    
331                    if (Validator.equals(_resourceAction,
332                                            resourceActionWrapper._resourceAction)) {
333                            return true;
334                    }
335    
336                    return false;
337            }
338    
339            /**
340             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
341             */
342            @Deprecated
343            public ResourceAction getWrappedResourceAction() {
344                    return _resourceAction;
345            }
346    
347            @Override
348            public ResourceAction getWrappedModel() {
349                    return _resourceAction;
350            }
351    
352            @Override
353            public boolean isEntityCacheEnabled() {
354                    return _resourceAction.isEntityCacheEnabled();
355            }
356    
357            @Override
358            public boolean isFinderCacheEnabled() {
359                    return _resourceAction.isFinderCacheEnabled();
360            }
361    
362            @Override
363            public void resetOriginalValues() {
364                    _resourceAction.resetOriginalValues();
365            }
366    
367            private final ResourceAction _resourceAction;
368    }