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