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    import com.liferay.portal.kernel.util.Validator;
023    
024    import java.io.Serializable;
025    
026    import java.util.HashMap;
027    import java.util.Map;
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 java.lang.Object clone() {
103                    return new ResourceActionWrapper((ResourceAction)_resourceAction.clone());
104            }
105    
106            @Override
107            public int compareTo(
108                    com.liferay.portal.kernel.model.ResourceAction resourceAction) {
109                    return _resourceAction.compareTo(resourceAction);
110            }
111    
112            /**
113            * Returns the action ID of this resource action.
114            *
115            * @return the action ID of this resource action
116            */
117            @Override
118            public java.lang.String getActionId() {
119                    return _resourceAction.getActionId();
120            }
121    
122            /**
123            * Returns the bitwise value of this resource action.
124            *
125            * @return the bitwise value of this resource action
126            */
127            @Override
128            public long getBitwiseValue() {
129                    return _resourceAction.getBitwiseValue();
130            }
131    
132            @Override
133            public ExpandoBridge getExpandoBridge() {
134                    return _resourceAction.getExpandoBridge();
135            }
136    
137            /**
138            * Returns the mvcc version of this resource action.
139            *
140            * @return the mvcc version of this resource action
141            */
142            @Override
143            public long getMvccVersion() {
144                    return _resourceAction.getMvccVersion();
145            }
146    
147            /**
148            * Returns the name of this resource action.
149            *
150            * @return the name of this resource action
151            */
152            @Override
153            public java.lang.String getName() {
154                    return _resourceAction.getName();
155            }
156    
157            /**
158            * Returns the primary key of this resource action.
159            *
160            * @return the primary key of this resource action
161            */
162            @Override
163            public long getPrimaryKey() {
164                    return _resourceAction.getPrimaryKey();
165            }
166    
167            @Override
168            public Serializable getPrimaryKeyObj() {
169                    return _resourceAction.getPrimaryKeyObj();
170            }
171    
172            /**
173            * Returns the resource action ID of this resource action.
174            *
175            * @return the resource action ID of this resource action
176            */
177            @Override
178            public long getResourceActionId() {
179                    return _resourceAction.getResourceActionId();
180            }
181    
182            @Override
183            public int hashCode() {
184                    return _resourceAction.hashCode();
185            }
186    
187            @Override
188            public boolean isCachedModel() {
189                    return _resourceAction.isCachedModel();
190            }
191    
192            @Override
193            public boolean isEscapedModel() {
194                    return _resourceAction.isEscapedModel();
195            }
196    
197            @Override
198            public boolean isNew() {
199                    return _resourceAction.isNew();
200            }
201    
202            @Override
203            public void persist() {
204                    _resourceAction.persist();
205            }
206    
207            /**
208            * Sets the action ID of this resource action.
209            *
210            * @param actionId the action ID of this resource action
211            */
212            @Override
213            public void setActionId(java.lang.String actionId) {
214                    _resourceAction.setActionId(actionId);
215            }
216    
217            /**
218            * Sets the bitwise value of this resource action.
219            *
220            * @param bitwiseValue the bitwise value of this resource action
221            */
222            @Override
223            public void setBitwiseValue(long bitwiseValue) {
224                    _resourceAction.setBitwiseValue(bitwiseValue);
225            }
226    
227            @Override
228            public void setCachedModel(boolean cachedModel) {
229                    _resourceAction.setCachedModel(cachedModel);
230            }
231    
232            @Override
233            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
234                    _resourceAction.setExpandoBridgeAttributes(baseModel);
235            }
236    
237            @Override
238            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
239                    _resourceAction.setExpandoBridgeAttributes(expandoBridge);
240            }
241    
242            @Override
243            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
244                    _resourceAction.setExpandoBridgeAttributes(serviceContext);
245            }
246    
247            /**
248            * Sets the mvcc version of this resource action.
249            *
250            * @param mvccVersion the mvcc version of this resource action
251            */
252            @Override
253            public void setMvccVersion(long mvccVersion) {
254                    _resourceAction.setMvccVersion(mvccVersion);
255            }
256    
257            /**
258            * Sets the name of this resource action.
259            *
260            * @param name the name of this resource action
261            */
262            @Override
263            public void setName(java.lang.String name) {
264                    _resourceAction.setName(name);
265            }
266    
267            @Override
268            public void setNew(boolean n) {
269                    _resourceAction.setNew(n);
270            }
271    
272            /**
273            * Sets the primary key of this resource action.
274            *
275            * @param primaryKey the primary key of this resource action
276            */
277            @Override
278            public void setPrimaryKey(long primaryKey) {
279                    _resourceAction.setPrimaryKey(primaryKey);
280            }
281    
282            @Override
283            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
284                    _resourceAction.setPrimaryKeyObj(primaryKeyObj);
285            }
286    
287            /**
288            * Sets the resource action ID of this resource action.
289            *
290            * @param resourceActionId the resource action ID of this resource action
291            */
292            @Override
293            public void setResourceActionId(long resourceActionId) {
294                    _resourceAction.setResourceActionId(resourceActionId);
295            }
296    
297            @Override
298            public CacheModel<com.liferay.portal.kernel.model.ResourceAction> toCacheModel() {
299                    return _resourceAction.toCacheModel();
300            }
301    
302            @Override
303            public com.liferay.portal.kernel.model.ResourceAction toEscapedModel() {
304                    return new ResourceActionWrapper(_resourceAction.toEscapedModel());
305            }
306    
307            @Override
308            public java.lang.String toString() {
309                    return _resourceAction.toString();
310            }
311    
312            @Override
313            public com.liferay.portal.kernel.model.ResourceAction toUnescapedModel() {
314                    return new ResourceActionWrapper(_resourceAction.toUnescapedModel());
315            }
316    
317            @Override
318            public java.lang.String toXmlString() {
319                    return _resourceAction.toXmlString();
320            }
321    
322            @Override
323            public boolean equals(Object obj) {
324                    if (this == obj) {
325                            return true;
326                    }
327    
328                    if (!(obj instanceof ResourceActionWrapper)) {
329                            return false;
330                    }
331    
332                    ResourceActionWrapper resourceActionWrapper = (ResourceActionWrapper)obj;
333    
334                    if (Validator.equals(_resourceAction,
335                                            resourceActionWrapper._resourceAction)) {
336                            return true;
337                    }
338    
339                    return false;
340            }
341    
342            @Override
343            public ResourceAction getWrappedModel() {
344                    return _resourceAction;
345            }
346    
347            @Override
348            public boolean isEntityCacheEnabled() {
349                    return _resourceAction.isEntityCacheEnabled();
350            }
351    
352            @Override
353            public boolean isFinderCacheEnabled() {
354                    return _resourceAction.isFinderCacheEnabled();
355            }
356    
357            @Override
358            public void resetOriginalValues() {
359                    _resourceAction.resetOriginalValues();
360            }
361    
362            private final ResourceAction _resourceAction;
363    }