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