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