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