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