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                    throws com.liferay.portal.kernel.exception.PortalException {
198                    return _backgroundTask.getAttachmentsFileEntries();
199            }
200    
201            @Override
202            public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getAttachmentsFileEntries(
203                    int start, int end)
204                    throws com.liferay.portal.kernel.exception.PortalException {
205                    return _backgroundTask.getAttachmentsFileEntries(start, end);
206            }
207    
208            @Override
209            public int getAttachmentsFileEntriesCount()
210                    throws com.liferay.portal.kernel.exception.PortalException {
211                    return _backgroundTask.getAttachmentsFileEntriesCount();
212            }
213    
214            @Override
215            public long getAttachmentsFolderId() {
216                    return _backgroundTask.getAttachmentsFolderId();
217            }
218    
219            @Override
220            public com.liferay.portal.kernel.backgroundtask.BackgroundTaskExecutor getBackgroundTaskExecutor() {
221                    return _backgroundTask.getBackgroundTaskExecutor();
222            }
223    
224            /**
225            * Returns the background task ID of this background task.
226            *
227            * @return the background task ID of this background task
228            */
229            @Override
230            public long getBackgroundTaskId() {
231                    return _backgroundTask.getBackgroundTaskId();
232            }
233    
234            /**
235            * Returns the company ID of this background task.
236            *
237            * @return the company ID of this background task
238            */
239            @Override
240            public long getCompanyId() {
241                    return _backgroundTask.getCompanyId();
242            }
243    
244            /**
245            * Returns the completed of this background task.
246            *
247            * @return the completed of this background task
248            */
249            @Override
250            public boolean getCompleted() {
251                    return _backgroundTask.getCompleted();
252            }
253    
254            /**
255            * Returns the completion date of this background task.
256            *
257            * @return the completion date of this background task
258            */
259            @Override
260            public Date getCompletionDate() {
261                    return _backgroundTask.getCompletionDate();
262            }
263    
264            /**
265            * Returns the create date of this background task.
266            *
267            * @return the create date of this background task
268            */
269            @Override
270            public Date getCreateDate() {
271                    return _backgroundTask.getCreateDate();
272            }
273    
274            @Override
275            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
276                    return _backgroundTask.getExpandoBridge();
277            }
278    
279            /**
280            * Returns the group ID of this background task.
281            *
282            * @return the group ID of this background task
283            */
284            @Override
285            public long getGroupId() {
286                    return _backgroundTask.getGroupId();
287            }
288    
289            /**
290            * Returns the modified date of this background task.
291            *
292            * @return the modified date of this background task
293            */
294            @Override
295            public Date getModifiedDate() {
296                    return _backgroundTask.getModifiedDate();
297            }
298    
299            /**
300            * Returns the mvcc version of this background task.
301            *
302            * @return the mvcc version of this background task
303            */
304            @Override
305            public long getMvccVersion() {
306                    return _backgroundTask.getMvccVersion();
307            }
308    
309            /**
310            * Returns the name of this background task.
311            *
312            * @return the name of this background task
313            */
314            @Override
315            public java.lang.String getName() {
316                    return _backgroundTask.getName();
317            }
318    
319            /**
320            * Returns the primary key of this background task.
321            *
322            * @return the primary key of this background task
323            */
324            @Override
325            public long getPrimaryKey() {
326                    return _backgroundTask.getPrimaryKey();
327            }
328    
329            @Override
330            public Serializable getPrimaryKeyObj() {
331                    return _backgroundTask.getPrimaryKeyObj();
332            }
333    
334            /**
335            * Returns the servlet context names of this background task.
336            *
337            * @return the servlet context names of this background task
338            */
339            @Override
340            public java.lang.String getServletContextNames() {
341                    return _backgroundTask.getServletContextNames();
342            }
343    
344            /**
345            * Returns the status of this background task.
346            *
347            * @return the status of this background task
348            */
349            @Override
350            public int getStatus() {
351                    return _backgroundTask.getStatus();
352            }
353    
354            @Override
355            public java.lang.String getStatusLabel() {
356                    return _backgroundTask.getStatusLabel();
357            }
358    
359            /**
360            * Returns the status message of this background task.
361            *
362            * @return the status message of this background task
363            */
364            @Override
365            public java.lang.String getStatusMessage() {
366                    return _backgroundTask.getStatusMessage();
367            }
368    
369            /**
370            * Returns the task context map of this background task.
371            *
372            * @return the task context map of this background task
373            */
374            @Override
375            public Map<java.lang.String, Serializable> getTaskContextMap() {
376                    return _backgroundTask.getTaskContextMap();
377            }
378    
379            /**
380            * Returns the task executor class name of this background task.
381            *
382            * @return the task executor class name of this background task
383            */
384            @Override
385            public java.lang.String getTaskExecutorClassName() {
386                    return _backgroundTask.getTaskExecutorClassName();
387            }
388    
389            /**
390            * Returns the user ID of this background task.
391            *
392            * @return the user ID of this background task
393            */
394            @Override
395            public long getUserId() {
396                    return _backgroundTask.getUserId();
397            }
398    
399            /**
400            * Returns the user name of this background task.
401            *
402            * @return the user name of this background task
403            */
404            @Override
405            public java.lang.String getUserName() {
406                    return _backgroundTask.getUserName();
407            }
408    
409            /**
410            * Returns the user uuid of this background task.
411            *
412            * @return the user uuid of this background task
413            */
414            @Override
415            public java.lang.String getUserUuid() {
416                    return _backgroundTask.getUserUuid();
417            }
418    
419            @Override
420            public int hashCode() {
421                    return _backgroundTask.hashCode();
422            }
423    
424            @Override
425            public boolean isCachedModel() {
426                    return _backgroundTask.isCachedModel();
427            }
428    
429            /**
430            * Returns <code>true</code> if this background task is completed.
431            *
432            * @return <code>true</code> if this background task is completed; <code>false</code> otherwise
433            */
434            @Override
435            public boolean isCompleted() {
436                    return _backgroundTask.isCompleted();
437            }
438    
439            @Override
440            public boolean isEscapedModel() {
441                    return _backgroundTask.isEscapedModel();
442            }
443    
444            @Override
445            public boolean isInProgress() {
446                    return _backgroundTask.isInProgress();
447            }
448    
449            @Override
450            public boolean isNew() {
451                    return _backgroundTask.isNew();
452            }
453    
454            @Override
455            public void persist() {
456                    _backgroundTask.persist();
457            }
458    
459            /**
460            * Sets the background task ID of this background task.
461            *
462            * @param backgroundTaskId the background task ID of this background task
463            */
464            @Override
465            public void setBackgroundTaskId(long backgroundTaskId) {
466                    _backgroundTask.setBackgroundTaskId(backgroundTaskId);
467            }
468    
469            @Override
470            public void setCachedModel(boolean cachedModel) {
471                    _backgroundTask.setCachedModel(cachedModel);
472            }
473    
474            /**
475            * Sets the company ID of this background task.
476            *
477            * @param companyId the company ID of this background task
478            */
479            @Override
480            public void setCompanyId(long companyId) {
481                    _backgroundTask.setCompanyId(companyId);
482            }
483    
484            /**
485            * Sets whether this background task is completed.
486            *
487            * @param completed the completed of this background task
488            */
489            @Override
490            public void setCompleted(boolean completed) {
491                    _backgroundTask.setCompleted(completed);
492            }
493    
494            /**
495            * Sets the completion date of this background task.
496            *
497            * @param completionDate the completion date of this background task
498            */
499            @Override
500            public void setCompletionDate(Date completionDate) {
501                    _backgroundTask.setCompletionDate(completionDate);
502            }
503    
504            /**
505            * Sets the create date of this background task.
506            *
507            * @param createDate the create date of this background task
508            */
509            @Override
510            public void setCreateDate(Date createDate) {
511                    _backgroundTask.setCreateDate(createDate);
512            }
513    
514            @Override
515            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
516                    _backgroundTask.setExpandoBridgeAttributes(baseModel);
517            }
518    
519            @Override
520            public void setExpandoBridgeAttributes(
521                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
522                    _backgroundTask.setExpandoBridgeAttributes(expandoBridge);
523            }
524    
525            @Override
526            public void setExpandoBridgeAttributes(
527                    com.liferay.portal.service.ServiceContext serviceContext) {
528                    _backgroundTask.setExpandoBridgeAttributes(serviceContext);
529            }
530    
531            /**
532            * Sets the group ID of this background task.
533            *
534            * @param groupId the group ID of this background task
535            */
536            @Override
537            public void setGroupId(long groupId) {
538                    _backgroundTask.setGroupId(groupId);
539            }
540    
541            /**
542            * Sets the modified date of this background task.
543            *
544            * @param modifiedDate the modified date of this background task
545            */
546            @Override
547            public void setModifiedDate(Date modifiedDate) {
548                    _backgroundTask.setModifiedDate(modifiedDate);
549            }
550    
551            /**
552            * Sets the mvcc version of this background task.
553            *
554            * @param mvccVersion the mvcc version of this background task
555            */
556            @Override
557            public void setMvccVersion(long mvccVersion) {
558                    _backgroundTask.setMvccVersion(mvccVersion);
559            }
560    
561            /**
562            * Sets the name of this background task.
563            *
564            * @param name the name of this background task
565            */
566            @Override
567            public void setName(java.lang.String name) {
568                    _backgroundTask.setName(name);
569            }
570    
571            @Override
572            public void setNew(boolean n) {
573                    _backgroundTask.setNew(n);
574            }
575    
576            /**
577            * Sets the primary key of this background task.
578            *
579            * @param primaryKey the primary key of this background task
580            */
581            @Override
582            public void setPrimaryKey(long primaryKey) {
583                    _backgroundTask.setPrimaryKey(primaryKey);
584            }
585    
586            @Override
587            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
588                    _backgroundTask.setPrimaryKeyObj(primaryKeyObj);
589            }
590    
591            /**
592            * Sets the servlet context names of this background task.
593            *
594            * @param servletContextNames the servlet context names of this background task
595            */
596            @Override
597            public void setServletContextNames(java.lang.String servletContextNames) {
598                    _backgroundTask.setServletContextNames(servletContextNames);
599            }
600    
601            /**
602            * Sets the status of this background task.
603            *
604            * @param status the status of this background task
605            */
606            @Override
607            public void setStatus(int status) {
608                    _backgroundTask.setStatus(status);
609            }
610    
611            /**
612            * Sets the status message of this background task.
613            *
614            * @param statusMessage the status message of this background task
615            */
616            @Override
617            public void setStatusMessage(java.lang.String statusMessage) {
618                    _backgroundTask.setStatusMessage(statusMessage);
619            }
620    
621            /**
622            * Sets the task context map of this background task.
623            *
624            * @param taskContextMap the task context map of this background task
625            */
626            @Override
627            public void setTaskContextMap(
628                    Map<java.lang.String, Serializable> taskContextMap) {
629                    _backgroundTask.setTaskContextMap(taskContextMap);
630            }
631    
632            /**
633            * Sets the task executor class name of this background task.
634            *
635            * @param taskExecutorClassName the task executor class name of this background task
636            */
637            @Override
638            public void setTaskExecutorClassName(java.lang.String taskExecutorClassName) {
639                    _backgroundTask.setTaskExecutorClassName(taskExecutorClassName);
640            }
641    
642            /**
643            * Sets the user ID of this background task.
644            *
645            * @param userId the user ID of this background task
646            */
647            @Override
648            public void setUserId(long userId) {
649                    _backgroundTask.setUserId(userId);
650            }
651    
652            /**
653            * Sets the user name of this background task.
654            *
655            * @param userName the user name of this background task
656            */
657            @Override
658            public void setUserName(java.lang.String userName) {
659                    _backgroundTask.setUserName(userName);
660            }
661    
662            /**
663            * Sets the user uuid of this background task.
664            *
665            * @param userUuid the user uuid of this background task
666            */
667            @Override
668            public void setUserUuid(java.lang.String userUuid) {
669                    _backgroundTask.setUserUuid(userUuid);
670            }
671    
672            @Override
673            public CacheModel<com.liferay.portal.model.BackgroundTask> toCacheModel() {
674                    return _backgroundTask.toCacheModel();
675            }
676    
677            @Override
678            public com.liferay.portal.model.BackgroundTask toEscapedModel() {
679                    return new BackgroundTaskWrapper(_backgroundTask.toEscapedModel());
680            }
681    
682            @Override
683            public java.lang.String toString() {
684                    return _backgroundTask.toString();
685            }
686    
687            @Override
688            public com.liferay.portal.model.BackgroundTask toUnescapedModel() {
689                    return new BackgroundTaskWrapper(_backgroundTask.toUnescapedModel());
690            }
691    
692            @Override
693            public java.lang.String toXmlString() {
694                    return _backgroundTask.toXmlString();
695            }
696    
697            @Override
698            public boolean equals(Object obj) {
699                    if (this == obj) {
700                            return true;
701                    }
702    
703                    if (!(obj instanceof BackgroundTaskWrapper)) {
704                            return false;
705                    }
706    
707                    BackgroundTaskWrapper backgroundTaskWrapper = (BackgroundTaskWrapper)obj;
708    
709                    if (Validator.equals(_backgroundTask,
710                                            backgroundTaskWrapper._backgroundTask)) {
711                            return true;
712                    }
713    
714                    return false;
715            }
716    
717            /**
718             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
719             */
720            @Deprecated
721            public BackgroundTask getWrappedBackgroundTask() {
722                    return _backgroundTask;
723            }
724    
725            @Override
726            public BackgroundTask getWrappedModel() {
727                    return _backgroundTask;
728            }
729    
730            @Override
731            public boolean isEntityCacheEnabled() {
732                    return _backgroundTask.isEntityCacheEnabled();
733            }
734    
735            @Override
736            public boolean isFinderCacheEnabled() {
737                    return _backgroundTask.isFinderCacheEnabled();
738            }
739    
740            @Override
741            public void resetOriginalValues() {
742                    _backgroundTask.resetOriginalValues();
743            }
744    
745            private final BackgroundTask _backgroundTask;
746    }