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