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