001
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
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
105 @Override
106 public long getPrimaryKey() {
107 return _scLicense.getPrimaryKey();
108 }
109
110
115 @Override
116 public void setPrimaryKey(long primaryKey) {
117 _scLicense.setPrimaryKey(primaryKey);
118 }
119
120
125 @Override
126 public long getLicenseId() {
127 return _scLicense.getLicenseId();
128 }
129
130
135 @Override
136 public void setLicenseId(long licenseId) {
137 _scLicense.setLicenseId(licenseId);
138 }
139
140
145 @Override
146 public java.lang.String getName() {
147 return _scLicense.getName();
148 }
149
150
155 @Override
156 public void setName(java.lang.String name) {
157 _scLicense.setName(name);
158 }
159
160
165 @Override
166 public java.lang.String getUrl() {
167 return _scLicense.getUrl();
168 }
169
170
175 @Override
176 public void setUrl(java.lang.String url) {
177 _scLicense.setUrl(url);
178 }
179
180
185 @Override
186 public boolean getOpenSource() {
187 return _scLicense.getOpenSource();
188 }
189
190
195 @Override
196 public boolean isOpenSource() {
197 return _scLicense.isOpenSource();
198 }
199
200
205 @Override
206 public void setOpenSource(boolean openSource) {
207 _scLicense.setOpenSource(openSource);
208 }
209
210
215 @Override
216 public boolean getActive() {
217 return _scLicense.getActive();
218 }
219
220
225 @Override
226 public boolean isActive() {
227 return _scLicense.isActive();
228 }
229
230
235 @Override
236 public void setActive(boolean active) {
237 _scLicense.setActive(active);
238 }
239
240
245 @Override
246 public boolean getRecommended() {
247 return _scLicense.getRecommended();
248 }
249
250
255 @Override
256 public boolean isRecommended() {
257 return _scLicense.isRecommended();
258 }
259
260
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
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 }