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