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