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