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