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(
252                    com.liferay.portal.model.BaseModel<?> baseModel) {
253                    _resourceBlock.setExpandoBridgeAttributes(baseModel);
254            }
255    
256            @Override
257            public void setExpandoBridgeAttributes(
258                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
259                    _resourceBlock.setExpandoBridgeAttributes(expandoBridge);
260            }
261    
262            @Override
263            public void setExpandoBridgeAttributes(
264                    com.liferay.portal.service.ServiceContext serviceContext) {
265                    _resourceBlock.setExpandoBridgeAttributes(serviceContext);
266            }
267    
268            /**
269            * Sets the group ID of this resource block.
270            *
271            * @param groupId the group ID of this resource block
272            */
273            @Override
274            public void setGroupId(long groupId) {
275                    _resourceBlock.setGroupId(groupId);
276            }
277    
278            /**
279            * Sets the mvcc version of this resource block.
280            *
281            * @param mvccVersion the mvcc version of this resource block
282            */
283            @Override
284            public void setMvccVersion(long mvccVersion) {
285                    _resourceBlock.setMvccVersion(mvccVersion);
286            }
287    
288            /**
289            * Sets the name of this resource block.
290            *
291            * @param name the name of this resource block
292            */
293            @Override
294            public void setName(java.lang.String name) {
295                    _resourceBlock.setName(name);
296            }
297    
298            @Override
299            public void setNew(boolean n) {
300                    _resourceBlock.setNew(n);
301            }
302    
303            /**
304            * Sets the permissions hash of this resource block.
305            *
306            * @param permissionsHash the permissions hash of this resource block
307            */
308            @Override
309            public void setPermissionsHash(java.lang.String permissionsHash) {
310                    _resourceBlock.setPermissionsHash(permissionsHash);
311            }
312    
313            /**
314            * Sets the primary key of this resource block.
315            *
316            * @param primaryKey the primary key of this resource block
317            */
318            @Override
319            public void setPrimaryKey(long primaryKey) {
320                    _resourceBlock.setPrimaryKey(primaryKey);
321            }
322    
323            @Override
324            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
325                    _resourceBlock.setPrimaryKeyObj(primaryKeyObj);
326            }
327    
328            /**
329            * Sets the reference count of this resource block.
330            *
331            * @param referenceCount the reference count of this resource block
332            */
333            @Override
334            public void setReferenceCount(long referenceCount) {
335                    _resourceBlock.setReferenceCount(referenceCount);
336            }
337    
338            /**
339            * Sets the resource block ID of this resource block.
340            *
341            * @param resourceBlockId the resource block ID of this resource block
342            */
343            @Override
344            public void setResourceBlockId(long resourceBlockId) {
345                    _resourceBlock.setResourceBlockId(resourceBlockId);
346            }
347    
348            @Override
349            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.ResourceBlock> toCacheModel() {
350                    return _resourceBlock.toCacheModel();
351            }
352    
353            @Override
354            public com.liferay.portal.model.ResourceBlock toEscapedModel() {
355                    return new ResourceBlockWrapper(_resourceBlock.toEscapedModel());
356            }
357    
358            @Override
359            public java.lang.String toString() {
360                    return _resourceBlock.toString();
361            }
362    
363            @Override
364            public com.liferay.portal.model.ResourceBlock toUnescapedModel() {
365                    return new ResourceBlockWrapper(_resourceBlock.toUnescapedModel());
366            }
367    
368            @Override
369            public java.lang.String toXmlString() {
370                    return _resourceBlock.toXmlString();
371            }
372    
373            @Override
374            public boolean equals(Object obj) {
375                    if (this == obj) {
376                            return true;
377                    }
378    
379                    if (!(obj instanceof ResourceBlockWrapper)) {
380                            return false;
381                    }
382    
383                    ResourceBlockWrapper resourceBlockWrapper = (ResourceBlockWrapper)obj;
384    
385                    if (Validator.equals(_resourceBlock, resourceBlockWrapper._resourceBlock)) {
386                            return true;
387                    }
388    
389                    return false;
390            }
391    
392            /**
393             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
394             */
395            @Deprecated
396            public ResourceBlock getWrappedResourceBlock() {
397                    return _resourceBlock;
398            }
399    
400            @Override
401            public ResourceBlock getWrappedModel() {
402                    return _resourceBlock;
403            }
404    
405            @Override
406            public boolean isEntityCacheEnabled() {
407                    return _resourceBlock.isEntityCacheEnabled();
408            }
409    
410            @Override
411            public boolean isFinderCacheEnabled() {
412                    return _resourceBlock.isFinderCacheEnabled();
413            }
414    
415            @Override
416            public void resetOriginalValues() {
417                    _resourceBlock.resetOriginalValues();
418            }
419    
420            private final ResourceBlock _resourceBlock;
421    }