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