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