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.portal.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    
019    import java.util.Date;
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link BackgroundTask}.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see BackgroundTask
030     * @generated
031     */
032    public class BackgroundTaskWrapper implements BackgroundTask,
033            ModelWrapper<BackgroundTask> {
034            public BackgroundTaskWrapper(BackgroundTask backgroundTask) {
035                    _backgroundTask = backgroundTask;
036            }
037    
038            @Override
039            public Class<?> getModelClass() {
040                    return BackgroundTask.class;
041            }
042    
043            @Override
044            public String getModelClassName() {
045                    return BackgroundTask.class.getName();
046            }
047    
048            @Override
049            public Map<String, Object> getModelAttributes() {
050                    Map<String, Object> attributes = new HashMap<String, Object>();
051    
052                    attributes.put("backgroundTaskId", getBackgroundTaskId());
053                    attributes.put("groupId", getGroupId());
054                    attributes.put("companyId", getCompanyId());
055                    attributes.put("userId", getUserId());
056                    attributes.put("userName", getUserName());
057                    attributes.put("createDate", getCreateDate());
058                    attributes.put("modifiedDate", getModifiedDate());
059                    attributes.put("name", getName());
060                    attributes.put("servletContextNames", getServletContextNames());
061                    attributes.put("taskExecutorClassName", getTaskExecutorClassName());
062                    attributes.put("taskContext", getTaskContext());
063                    attributes.put("completed", getCompleted());
064                    attributes.put("completionDate", getCompletionDate());
065                    attributes.put("status", getStatus());
066                    attributes.put("statusMessage", getStatusMessage());
067    
068                    return attributes;
069            }
070    
071            @Override
072            public void setModelAttributes(Map<String, Object> attributes) {
073                    Long backgroundTaskId = (Long)attributes.get("backgroundTaskId");
074    
075                    if (backgroundTaskId != null) {
076                            setBackgroundTaskId(backgroundTaskId);
077                    }
078    
079                    Long groupId = (Long)attributes.get("groupId");
080    
081                    if (groupId != null) {
082                            setGroupId(groupId);
083                    }
084    
085                    Long companyId = (Long)attributes.get("companyId");
086    
087                    if (companyId != null) {
088                            setCompanyId(companyId);
089                    }
090    
091                    Long userId = (Long)attributes.get("userId");
092    
093                    if (userId != null) {
094                            setUserId(userId);
095                    }
096    
097                    String userName = (String)attributes.get("userName");
098    
099                    if (userName != null) {
100                            setUserName(userName);
101                    }
102    
103                    Date createDate = (Date)attributes.get("createDate");
104    
105                    if (createDate != null) {
106                            setCreateDate(createDate);
107                    }
108    
109                    Date modifiedDate = (Date)attributes.get("modifiedDate");
110    
111                    if (modifiedDate != null) {
112                            setModifiedDate(modifiedDate);
113                    }
114    
115                    String name = (String)attributes.get("name");
116    
117                    if (name != null) {
118                            setName(name);
119                    }
120    
121                    String servletContextNames = (String)attributes.get(
122                                    "servletContextNames");
123    
124                    if (servletContextNames != null) {
125                            setServletContextNames(servletContextNames);
126                    }
127    
128                    String taskExecutorClassName = (String)attributes.get(
129                                    "taskExecutorClassName");
130    
131                    if (taskExecutorClassName != null) {
132                            setTaskExecutorClassName(taskExecutorClassName);
133                    }
134    
135                    String taskContext = (String)attributes.get("taskContext");
136    
137                    if (taskContext != null) {
138                            setTaskContext(taskContext);
139                    }
140    
141                    Boolean completed = (Boolean)attributes.get("completed");
142    
143                    if (completed != null) {
144                            setCompleted(completed);
145                    }
146    
147                    Date completionDate = (Date)attributes.get("completionDate");
148    
149                    if (completionDate != null) {
150                            setCompletionDate(completionDate);
151                    }
152    
153                    Integer status = (Integer)attributes.get("status");
154    
155                    if (status != null) {
156                            setStatus(status);
157                    }
158    
159                    String statusMessage = (String)attributes.get("statusMessage");
160    
161                    if (statusMessage != null) {
162                            setStatusMessage(statusMessage);
163                    }
164            }
165    
166            /**
167            * Returns the primary key of this background task.
168            *
169            * @return the primary key of this background task
170            */
171            @Override
172            public long getPrimaryKey() {
173                    return _backgroundTask.getPrimaryKey();
174            }
175    
176            /**
177            * Sets the primary key of this background task.
178            *
179            * @param primaryKey the primary key of this background task
180            */
181            @Override
182            public void setPrimaryKey(long primaryKey) {
183                    _backgroundTask.setPrimaryKey(primaryKey);
184            }
185    
186            /**
187            * Returns the background task ID of this background task.
188            *
189            * @return the background task ID of this background task
190            */
191            @Override
192            public long getBackgroundTaskId() {
193                    return _backgroundTask.getBackgroundTaskId();
194            }
195    
196            /**
197            * Sets the background task ID of this background task.
198            *
199            * @param backgroundTaskId the background task ID of this background task
200            */
201            @Override
202            public void setBackgroundTaskId(long backgroundTaskId) {
203                    _backgroundTask.setBackgroundTaskId(backgroundTaskId);
204            }
205    
206            /**
207            * Returns the group ID of this background task.
208            *
209            * @return the group ID of this background task
210            */
211            @Override
212            public long getGroupId() {
213                    return _backgroundTask.getGroupId();
214            }
215    
216            /**
217            * Sets the group ID of this background task.
218            *
219            * @param groupId the group ID of this background task
220            */
221            @Override
222            public void setGroupId(long groupId) {
223                    _backgroundTask.setGroupId(groupId);
224            }
225    
226            /**
227            * Returns the company ID of this background task.
228            *
229            * @return the company ID of this background task
230            */
231            @Override
232            public long getCompanyId() {
233                    return _backgroundTask.getCompanyId();
234            }
235    
236            /**
237            * Sets the company ID of this background task.
238            *
239            * @param companyId the company ID of this background task
240            */
241            @Override
242            public void setCompanyId(long companyId) {
243                    _backgroundTask.setCompanyId(companyId);
244            }
245    
246            /**
247            * Returns the user ID of this background task.
248            *
249            * @return the user ID of this background task
250            */
251            @Override
252            public long getUserId() {
253                    return _backgroundTask.getUserId();
254            }
255    
256            /**
257            * Sets the user ID of this background task.
258            *
259            * @param userId the user ID of this background task
260            */
261            @Override
262            public void setUserId(long userId) {
263                    _backgroundTask.setUserId(userId);
264            }
265    
266            /**
267            * Returns the user uuid of this background task.
268            *
269            * @return the user uuid of this background task
270            * @throws SystemException if a system exception occurred
271            */
272            @Override
273            public java.lang.String getUserUuid()
274                    throws com.liferay.portal.kernel.exception.SystemException {
275                    return _backgroundTask.getUserUuid();
276            }
277    
278            /**
279            * Sets the user uuid of this background task.
280            *
281            * @param userUuid the user uuid of this background task
282            */
283            @Override
284            public void setUserUuid(java.lang.String userUuid) {
285                    _backgroundTask.setUserUuid(userUuid);
286            }
287    
288            /**
289            * Returns the user name of this background task.
290            *
291            * @return the user name of this background task
292            */
293            @Override
294            public java.lang.String getUserName() {
295                    return _backgroundTask.getUserName();
296            }
297    
298            /**
299            * Sets the user name of this background task.
300            *
301            * @param userName the user name of this background task
302            */
303            @Override
304            public void setUserName(java.lang.String userName) {
305                    _backgroundTask.setUserName(userName);
306            }
307    
308            /**
309            * Returns the create date of this background task.
310            *
311            * @return the create date of this background task
312            */
313            @Override
314            public java.util.Date getCreateDate() {
315                    return _backgroundTask.getCreateDate();
316            }
317    
318            /**
319            * Sets the create date of this background task.
320            *
321            * @param createDate the create date of this background task
322            */
323            @Override
324            public void setCreateDate(java.util.Date createDate) {
325                    _backgroundTask.setCreateDate(createDate);
326            }
327    
328            /**
329            * Returns the modified date of this background task.
330            *
331            * @return the modified date of this background task
332            */
333            @Override
334            public java.util.Date getModifiedDate() {
335                    return _backgroundTask.getModifiedDate();
336            }
337    
338            /**
339            * Sets the modified date of this background task.
340            *
341            * @param modifiedDate the modified date of this background task
342            */
343            @Override
344            public void setModifiedDate(java.util.Date modifiedDate) {
345                    _backgroundTask.setModifiedDate(modifiedDate);
346            }
347    
348            /**
349            * Returns the name of this background task.
350            *
351            * @return the name of this background task
352            */
353            @Override
354            public java.lang.String getName() {
355                    return _backgroundTask.getName();
356            }
357    
358            /**
359            * Sets the name of this background task.
360            *
361            * @param name the name of this background task
362            */
363            @Override
364            public void setName(java.lang.String name) {
365                    _backgroundTask.setName(name);
366            }
367    
368            /**
369            * Returns the servlet context names of this background task.
370            *
371            * @return the servlet context names of this background task
372            */
373            @Override
374            public java.lang.String getServletContextNames() {
375                    return _backgroundTask.getServletContextNames();
376            }
377    
378            /**
379            * Sets the servlet context names of this background task.
380            *
381            * @param servletContextNames the servlet context names of this background task
382            */
383            @Override
384            public void setServletContextNames(java.lang.String servletContextNames) {
385                    _backgroundTask.setServletContextNames(servletContextNames);
386            }
387    
388            /**
389            * Returns the task executor class name of this background task.
390            *
391            * @return the task executor class name of this background task
392            */
393            @Override
394            public java.lang.String getTaskExecutorClassName() {
395                    return _backgroundTask.getTaskExecutorClassName();
396            }
397    
398            /**
399            * Sets the task executor class name of this background task.
400            *
401            * @param taskExecutorClassName the task executor class name of this background task
402            */
403            @Override
404            public void setTaskExecutorClassName(java.lang.String taskExecutorClassName) {
405                    _backgroundTask.setTaskExecutorClassName(taskExecutorClassName);
406            }
407    
408            /**
409            * Returns the task context of this background task.
410            *
411            * @return the task context of this background task
412            */
413            @Override
414            public java.lang.String getTaskContext() {
415                    return _backgroundTask.getTaskContext();
416            }
417    
418            /**
419            * Sets the task context of this background task.
420            *
421            * @param taskContext the task context of this background task
422            */
423            @Override
424            public void setTaskContext(java.lang.String taskContext) {
425                    _backgroundTask.setTaskContext(taskContext);
426            }
427    
428            /**
429            * Returns the completed of this background task.
430            *
431            * @return the completed of this background task
432            */
433            @Override
434            public boolean getCompleted() {
435                    return _backgroundTask.getCompleted();
436            }
437    
438            /**
439            * Returns <code>true</code> if this background task is completed.
440            *
441            * @return <code>true</code> if this background task is completed; <code>false</code> otherwise
442            */
443            @Override
444            public boolean isCompleted() {
445                    return _backgroundTask.isCompleted();
446            }
447    
448            /**
449            * Sets whether this background task is completed.
450            *
451            * @param completed the completed of this background task
452            */
453            @Override
454            public void setCompleted(boolean completed) {
455                    _backgroundTask.setCompleted(completed);
456            }
457    
458            /**
459            * Returns the completion date of this background task.
460            *
461            * @return the completion date of this background task
462            */
463            @Override
464            public java.util.Date getCompletionDate() {
465                    return _backgroundTask.getCompletionDate();
466            }
467    
468            /**
469            * Sets the completion date of this background task.
470            *
471            * @param completionDate the completion date of this background task
472            */
473            @Override
474            public void setCompletionDate(java.util.Date completionDate) {
475                    _backgroundTask.setCompletionDate(completionDate);
476            }
477    
478            /**
479            * Returns the status of this background task.
480            *
481            * @return the status of this background task
482            */
483            @Override
484            public int getStatus() {
485                    return _backgroundTask.getStatus();
486            }
487    
488            /**
489            * Sets the status of this background task.
490            *
491            * @param status the status of this background task
492            */
493            @Override
494            public void setStatus(int status) {
495                    _backgroundTask.setStatus(status);
496            }
497    
498            /**
499            * Returns the status message of this background task.
500            *
501            * @return the status message of this background task
502            */
503            @Override
504            public java.lang.String getStatusMessage() {
505                    return _backgroundTask.getStatusMessage();
506            }
507    
508            /**
509            * Sets the status message of this background task.
510            *
511            * @param statusMessage the status message of this background task
512            */
513            @Override
514            public void setStatusMessage(java.lang.String statusMessage) {
515                    _backgroundTask.setStatusMessage(statusMessage);
516            }
517    
518            @Override
519            public boolean isNew() {
520                    return _backgroundTask.isNew();
521            }
522    
523            @Override
524            public void setNew(boolean n) {
525                    _backgroundTask.setNew(n);
526            }
527    
528            @Override
529            public boolean isCachedModel() {
530                    return _backgroundTask.isCachedModel();
531            }
532    
533            @Override
534            public void setCachedModel(boolean cachedModel) {
535                    _backgroundTask.setCachedModel(cachedModel);
536            }
537    
538            @Override
539            public boolean isEscapedModel() {
540                    return _backgroundTask.isEscapedModel();
541            }
542    
543            @Override
544            public java.io.Serializable getPrimaryKeyObj() {
545                    return _backgroundTask.getPrimaryKeyObj();
546            }
547    
548            @Override
549            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
550                    _backgroundTask.setPrimaryKeyObj(primaryKeyObj);
551            }
552    
553            @Override
554            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
555                    return _backgroundTask.getExpandoBridge();
556            }
557    
558            @Override
559            public void setExpandoBridgeAttributes(
560                    com.liferay.portal.model.BaseModel<?> baseModel) {
561                    _backgroundTask.setExpandoBridgeAttributes(baseModel);
562            }
563    
564            @Override
565            public void setExpandoBridgeAttributes(
566                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
567                    _backgroundTask.setExpandoBridgeAttributes(expandoBridge);
568            }
569    
570            @Override
571            public void setExpandoBridgeAttributes(
572                    com.liferay.portal.service.ServiceContext serviceContext) {
573                    _backgroundTask.setExpandoBridgeAttributes(serviceContext);
574            }
575    
576            @Override
577            public java.lang.Object clone() {
578                    return new BackgroundTaskWrapper((BackgroundTask)_backgroundTask.clone());
579            }
580    
581            @Override
582            public int compareTo(com.liferay.portal.model.BackgroundTask backgroundTask) {
583                    return _backgroundTask.compareTo(backgroundTask);
584            }
585    
586            @Override
587            public int hashCode() {
588                    return _backgroundTask.hashCode();
589            }
590    
591            @Override
592            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.BackgroundTask> toCacheModel() {
593                    return _backgroundTask.toCacheModel();
594            }
595    
596            @Override
597            public com.liferay.portal.model.BackgroundTask toEscapedModel() {
598                    return new BackgroundTaskWrapper(_backgroundTask.toEscapedModel());
599            }
600    
601            @Override
602            public com.liferay.portal.model.BackgroundTask toUnescapedModel() {
603                    return new BackgroundTaskWrapper(_backgroundTask.toUnescapedModel());
604            }
605    
606            @Override
607            public java.lang.String toString() {
608                    return _backgroundTask.toString();
609            }
610    
611            @Override
612            public java.lang.String toXmlString() {
613                    return _backgroundTask.toXmlString();
614            }
615    
616            @Override
617            public void persist()
618                    throws com.liferay.portal.kernel.exception.SystemException {
619                    _backgroundTask.persist();
620            }
621    
622            @Override
623            public com.liferay.portal.kernel.repository.model.Folder addAttachmentsFolder()
624                    throws com.liferay.portal.kernel.exception.PortalException,
625                            com.liferay.portal.kernel.exception.SystemException {
626                    return _backgroundTask.addAttachmentsFolder();
627            }
628    
629            @Override
630            public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getAttachmentsFileEntries()
631                    throws com.liferay.portal.kernel.exception.SystemException {
632                    return _backgroundTask.getAttachmentsFileEntries();
633            }
634    
635            @Override
636            public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getAttachmentsFileEntries(
637                    int start, int end)
638                    throws com.liferay.portal.kernel.exception.SystemException {
639                    return _backgroundTask.getAttachmentsFileEntries(start, end);
640            }
641    
642            @Override
643            public int getAttachmentsFileEntriesCount()
644                    throws com.liferay.portal.kernel.exception.SystemException {
645                    return _backgroundTask.getAttachmentsFileEntriesCount();
646            }
647    
648            @Override
649            public long getAttachmentsFolderId()
650                    throws com.liferay.portal.kernel.exception.SystemException {
651                    return _backgroundTask.getAttachmentsFolderId();
652            }
653    
654            @Override
655            public java.lang.String getStatusLabel() {
656                    return _backgroundTask.getStatusLabel();
657            }
658    
659            @Override
660            public java.util.Map<java.lang.String, java.io.Serializable> getTaskContextMap() {
661                    return _backgroundTask.getTaskContextMap();
662            }
663    
664            @Override
665            public boolean isInProgress() {
666                    return _backgroundTask.isInProgress();
667            }
668    
669            @Override
670            public boolean equals(Object obj) {
671                    if (this == obj) {
672                            return true;
673                    }
674    
675                    if (!(obj instanceof BackgroundTaskWrapper)) {
676                            return false;
677                    }
678    
679                    BackgroundTaskWrapper backgroundTaskWrapper = (BackgroundTaskWrapper)obj;
680    
681                    if (Validator.equals(_backgroundTask,
682                                            backgroundTaskWrapper._backgroundTask)) {
683                            return true;
684                    }
685    
686                    return false;
687            }
688    
689            /**
690             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
691             */
692            public BackgroundTask getWrappedBackgroundTask() {
693                    return _backgroundTask;
694            }
695    
696            @Override
697            public BackgroundTask getWrappedModel() {
698                    return _backgroundTask;
699            }
700    
701            @Override
702            public void resetOriginalValues() {
703                    _backgroundTask.resetOriginalValues();
704            }
705    
706            private BackgroundTask _backgroundTask;
707    }