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