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    import com.liferay.portal.service.ServiceContext;
021    
022    import com.liferay.portlet.expando.model.ExpandoBridge;
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(com.liferay.portal.model.ResourceBlock resourceBlock) {
122                    return _resourceBlock.compareTo(resourceBlock);
123            }
124    
125            /**
126            * Returns the company ID of this resource block.
127            *
128            * @return the company ID of this resource block
129            */
130            @Override
131            public long getCompanyId() {
132                    return _resourceBlock.getCompanyId();
133            }
134    
135            @Override
136            public ExpandoBridge getExpandoBridge() {
137                    return _resourceBlock.getExpandoBridge();
138            }
139    
140            /**
141            * Returns the group ID of this resource block.
142            *
143            * @return the group ID of this resource block
144            */
145            @Override
146            public long getGroupId() {
147                    return _resourceBlock.getGroupId();
148            }
149    
150            /**
151            * Returns the mvcc version of this resource block.
152            *
153            * @return the mvcc version of this resource block
154            */
155            @Override
156            public long getMvccVersion() {
157                    return _resourceBlock.getMvccVersion();
158            }
159    
160            /**
161            * Returns the name of this resource block.
162            *
163            * @return the name of this resource block
164            */
165            @Override
166            public java.lang.String getName() {
167                    return _resourceBlock.getName();
168            }
169    
170            /**
171            * Returns the permissions hash of this resource block.
172            *
173            * @return the permissions hash of this resource block
174            */
175            @Override
176            public java.lang.String getPermissionsHash() {
177                    return _resourceBlock.getPermissionsHash();
178            }
179    
180            /**
181            * Returns the primary key of this resource block.
182            *
183            * @return the primary key of this resource block
184            */
185            @Override
186            public long getPrimaryKey() {
187                    return _resourceBlock.getPrimaryKey();
188            }
189    
190            @Override
191            public Serializable getPrimaryKeyObj() {
192                    return _resourceBlock.getPrimaryKeyObj();
193            }
194    
195            /**
196            * Returns the reference count of this resource block.
197            *
198            * @return the reference count of this resource block
199            */
200            @Override
201            public long getReferenceCount() {
202                    return _resourceBlock.getReferenceCount();
203            }
204    
205            /**
206            * Returns the resource block ID of this resource block.
207            *
208            * @return the resource block ID of this resource block
209            */
210            @Override
211            public long getResourceBlockId() {
212                    return _resourceBlock.getResourceBlockId();
213            }
214    
215            @Override
216            public int hashCode() {
217                    return _resourceBlock.hashCode();
218            }
219    
220            @Override
221            public boolean isCachedModel() {
222                    return _resourceBlock.isCachedModel();
223            }
224    
225            @Override
226            public boolean isEscapedModel() {
227                    return _resourceBlock.isEscapedModel();
228            }
229    
230            @Override
231            public boolean isNew() {
232                    return _resourceBlock.isNew();
233            }
234    
235            @Override
236            public void persist() {
237                    _resourceBlock.persist();
238            }
239    
240            @Override
241            public void setCachedModel(boolean cachedModel) {
242                    _resourceBlock.setCachedModel(cachedModel);
243            }
244    
245            /**
246            * Sets the company ID of this resource block.
247            *
248            * @param companyId the company ID of this resource block
249            */
250            @Override
251            public void setCompanyId(long companyId) {
252                    _resourceBlock.setCompanyId(companyId);
253            }
254    
255            @Override
256            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
257                    _resourceBlock.setExpandoBridgeAttributes(baseModel);
258            }
259    
260            @Override
261            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
262                    _resourceBlock.setExpandoBridgeAttributes(expandoBridge);
263            }
264    
265            @Override
266            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
267                    _resourceBlock.setExpandoBridgeAttributes(serviceContext);
268            }
269    
270            /**
271            * Sets the group ID of this resource block.
272            *
273            * @param groupId the group ID of this resource block
274            */
275            @Override
276            public void setGroupId(long groupId) {
277                    _resourceBlock.setGroupId(groupId);
278            }
279    
280            /**
281            * Sets the mvcc version of this resource block.
282            *
283            * @param mvccVersion the mvcc version of this resource block
284            */
285            @Override
286            public void setMvccVersion(long mvccVersion) {
287                    _resourceBlock.setMvccVersion(mvccVersion);
288            }
289    
290            /**
291            * Sets the name of this resource block.
292            *
293            * @param name the name of this resource block
294            */
295            @Override
296            public void setName(java.lang.String name) {
297                    _resourceBlock.setName(name);
298            }
299    
300            @Override
301            public void setNew(boolean n) {
302                    _resourceBlock.setNew(n);
303            }
304    
305            /**
306            * Sets the permissions hash of this resource block.
307            *
308            * @param permissionsHash the permissions hash of this resource block
309            */
310            @Override
311            public void setPermissionsHash(java.lang.String permissionsHash) {
312                    _resourceBlock.setPermissionsHash(permissionsHash);
313            }
314    
315            /**
316            * Sets the primary key of this resource block.
317            *
318            * @param primaryKey the primary key of this resource block
319            */
320            @Override
321            public void setPrimaryKey(long primaryKey) {
322                    _resourceBlock.setPrimaryKey(primaryKey);
323            }
324    
325            @Override
326            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
327                    _resourceBlock.setPrimaryKeyObj(primaryKeyObj);
328            }
329    
330            /**
331            * Sets the reference count of this resource block.
332            *
333            * @param referenceCount the reference count of this resource block
334            */
335            @Override
336            public void setReferenceCount(long referenceCount) {
337                    _resourceBlock.setReferenceCount(referenceCount);
338            }
339    
340            /**
341            * Sets the resource block ID of this resource block.
342            *
343            * @param resourceBlockId the resource block ID of this resource block
344            */
345            @Override
346            public void setResourceBlockId(long resourceBlockId) {
347                    _resourceBlock.setResourceBlockId(resourceBlockId);
348            }
349    
350            @Override
351            public CacheModel<com.liferay.portal.model.ResourceBlock> toCacheModel() {
352                    return _resourceBlock.toCacheModel();
353            }
354    
355            @Override
356            public com.liferay.portal.model.ResourceBlock toEscapedModel() {
357                    return new ResourceBlockWrapper(_resourceBlock.toEscapedModel());
358            }
359    
360            @Override
361            public java.lang.String toString() {
362                    return _resourceBlock.toString();
363            }
364    
365            @Override
366            public com.liferay.portal.model.ResourceBlock toUnescapedModel() {
367                    return new ResourceBlockWrapper(_resourceBlock.toUnescapedModel());
368            }
369    
370            @Override
371            public java.lang.String toXmlString() {
372                    return _resourceBlock.toXmlString();
373            }
374    
375            @Override
376            public boolean equals(Object obj) {
377                    if (this == obj) {
378                            return true;
379                    }
380    
381                    if (!(obj instanceof ResourceBlockWrapper)) {
382                            return false;
383                    }
384    
385                    ResourceBlockWrapper resourceBlockWrapper = (ResourceBlockWrapper)obj;
386    
387                    if (Validator.equals(_resourceBlock, resourceBlockWrapper._resourceBlock)) {
388                            return true;
389                    }
390    
391                    return false;
392            }
393    
394            @Override
395            public ResourceBlock getWrappedModel() {
396                    return _resourceBlock;
397            }
398    
399            @Override
400            public boolean isEntityCacheEnabled() {
401                    return _resourceBlock.isEntityCacheEnabled();
402            }
403    
404            @Override
405            public boolean isFinderCacheEnabled() {
406                    return _resourceBlock.isFinderCacheEnabled();
407            }
408    
409            @Override
410            public void resetOriginalValues() {
411                    _resourceBlock.resetOriginalValues();
412            }
413    
414            private final ResourceBlock _resourceBlock;
415    }