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 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("resourceActionId", getResourceActionId());
055                    attributes.put("name", getName());
056                    attributes.put("actionId", getActionId());
057                    attributes.put("bitwiseValue", getBitwiseValue());
058    
059                    return attributes;
060            }
061    
062            @Override
063            public void setModelAttributes(Map<String, Object> attributes) {
064                    Long resourceActionId = (Long)attributes.get("resourceActionId");
065    
066                    if (resourceActionId != null) {
067                            setResourceActionId(resourceActionId);
068                    }
069    
070                    String name = (String)attributes.get("name");
071    
072                    if (name != null) {
073                            setName(name);
074                    }
075    
076                    String actionId = (String)attributes.get("actionId");
077    
078                    if (actionId != null) {
079                            setActionId(actionId);
080                    }
081    
082                    Long bitwiseValue = (Long)attributes.get("bitwiseValue");
083    
084                    if (bitwiseValue != null) {
085                            setBitwiseValue(bitwiseValue);
086                    }
087            }
088    
089            /**
090            * Returns the primary key of this resource action.
091            *
092            * @return the primary key of this resource action
093            */
094            @Override
095            public long getPrimaryKey() {
096                    return _resourceAction.getPrimaryKey();
097            }
098    
099            /**
100            * Sets the primary key of this resource action.
101            *
102            * @param primaryKey the primary key of this resource action
103            */
104            @Override
105            public void setPrimaryKey(long primaryKey) {
106                    _resourceAction.setPrimaryKey(primaryKey);
107            }
108    
109            /**
110            * Returns the resource action ID of this resource action.
111            *
112            * @return the resource action ID of this resource action
113            */
114            @Override
115            public long getResourceActionId() {
116                    return _resourceAction.getResourceActionId();
117            }
118    
119            /**
120            * Sets the resource action ID of this resource action.
121            *
122            * @param resourceActionId the resource action ID of this resource action
123            */
124            @Override
125            public void setResourceActionId(long resourceActionId) {
126                    _resourceAction.setResourceActionId(resourceActionId);
127            }
128    
129            /**
130            * Returns the name of this resource action.
131            *
132            * @return the name of this resource action
133            */
134            @Override
135            public java.lang.String getName() {
136                    return _resourceAction.getName();
137            }
138    
139            /**
140            * Sets the name of this resource action.
141            *
142            * @param name the name of this resource action
143            */
144            @Override
145            public void setName(java.lang.String name) {
146                    _resourceAction.setName(name);
147            }
148    
149            /**
150            * Returns the action ID of this resource action.
151            *
152            * @return the action ID of this resource action
153            */
154            @Override
155            public java.lang.String getActionId() {
156                    return _resourceAction.getActionId();
157            }
158    
159            /**
160            * Sets the action ID of this resource action.
161            *
162            * @param actionId the action ID of this resource action
163            */
164            @Override
165            public void setActionId(java.lang.String actionId) {
166                    _resourceAction.setActionId(actionId);
167            }
168    
169            /**
170            * Returns the bitwise value of this resource action.
171            *
172            * @return the bitwise value of this resource action
173            */
174            @Override
175            public long getBitwiseValue() {
176                    return _resourceAction.getBitwiseValue();
177            }
178    
179            /**
180            * Sets the bitwise value of this resource action.
181            *
182            * @param bitwiseValue the bitwise value of this resource action
183            */
184            @Override
185            public void setBitwiseValue(long bitwiseValue) {
186                    _resourceAction.setBitwiseValue(bitwiseValue);
187            }
188    
189            @Override
190            public boolean isNew() {
191                    return _resourceAction.isNew();
192            }
193    
194            @Override
195            public void setNew(boolean n) {
196                    _resourceAction.setNew(n);
197            }
198    
199            @Override
200            public boolean isCachedModel() {
201                    return _resourceAction.isCachedModel();
202            }
203    
204            @Override
205            public void setCachedModel(boolean cachedModel) {
206                    _resourceAction.setCachedModel(cachedModel);
207            }
208    
209            @Override
210            public boolean isEscapedModel() {
211                    return _resourceAction.isEscapedModel();
212            }
213    
214            @Override
215            public java.io.Serializable getPrimaryKeyObj() {
216                    return _resourceAction.getPrimaryKeyObj();
217            }
218    
219            @Override
220            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
221                    _resourceAction.setPrimaryKeyObj(primaryKeyObj);
222            }
223    
224            @Override
225            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
226                    return _resourceAction.getExpandoBridge();
227            }
228    
229            @Override
230            public void setExpandoBridgeAttributes(
231                    com.liferay.portal.model.BaseModel<?> baseModel) {
232                    _resourceAction.setExpandoBridgeAttributes(baseModel);
233            }
234    
235            @Override
236            public void setExpandoBridgeAttributes(
237                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
238                    _resourceAction.setExpandoBridgeAttributes(expandoBridge);
239            }
240    
241            @Override
242            public void setExpandoBridgeAttributes(
243                    com.liferay.portal.service.ServiceContext serviceContext) {
244                    _resourceAction.setExpandoBridgeAttributes(serviceContext);
245            }
246    
247            @Override
248            public java.lang.Object clone() {
249                    return new ResourceActionWrapper((ResourceAction)_resourceAction.clone());
250            }
251    
252            @Override
253            public int compareTo(com.liferay.portal.model.ResourceAction resourceAction) {
254                    return _resourceAction.compareTo(resourceAction);
255            }
256    
257            @Override
258            public int hashCode() {
259                    return _resourceAction.hashCode();
260            }
261    
262            @Override
263            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceAction> toCacheModel() {
264                    return _resourceAction.toCacheModel();
265            }
266    
267            @Override
268            public com.liferay.portal.model.ResourceAction toEscapedModel() {
269                    return new ResourceActionWrapper(_resourceAction.toEscapedModel());
270            }
271    
272            @Override
273            public com.liferay.portal.model.ResourceAction toUnescapedModel() {
274                    return new ResourceActionWrapper(_resourceAction.toUnescapedModel());
275            }
276    
277            @Override
278            public java.lang.String toString() {
279                    return _resourceAction.toString();
280            }
281    
282            @Override
283            public java.lang.String toXmlString() {
284                    return _resourceAction.toXmlString();
285            }
286    
287            @Override
288            public void persist()
289                    throws com.liferay.portal.kernel.exception.SystemException {
290                    _resourceAction.persist();
291            }
292    
293            @Override
294            public boolean equals(Object obj) {
295                    if (this == obj) {
296                            return true;
297                    }
298    
299                    if (!(obj instanceof ResourceActionWrapper)) {
300                            return false;
301                    }
302    
303                    ResourceActionWrapper resourceActionWrapper = (ResourceActionWrapper)obj;
304    
305                    if (Validator.equals(_resourceAction,
306                                            resourceActionWrapper._resourceAction)) {
307                            return true;
308                    }
309    
310                    return false;
311            }
312    
313            /**
314             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
315             */
316            public ResourceAction getWrappedResourceAction() {
317                    return _resourceAction;
318            }
319    
320            @Override
321            public ResourceAction getWrappedModel() {
322                    return _resourceAction;
323            }
324    
325            @Override
326            public void resetOriginalValues() {
327                    _resourceAction.resetOriginalValues();
328            }
329    
330            private ResourceAction _resourceAction;
331    }