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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.service.ServiceContext;
022    
023    import java.io.Serializable;
024    
025    import java.util.HashMap;
026    import java.util.Map;
027    import java.util.Objects;
028    
029    /**
030     * <p>
031     * This class is a wrapper for {@link UserNotificationEvent}.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see UserNotificationEvent
036     * @generated
037     */
038    @ProviderType
039    public class UserNotificationEventWrapper implements UserNotificationEvent,
040            ModelWrapper<UserNotificationEvent> {
041            public UserNotificationEventWrapper(
042                    UserNotificationEvent userNotificationEvent) {
043                    _userNotificationEvent = userNotificationEvent;
044            }
045    
046            @Override
047            public Class<?> getModelClass() {
048                    return UserNotificationEvent.class;
049            }
050    
051            @Override
052            public String getModelClassName() {
053                    return UserNotificationEvent.class.getName();
054            }
055    
056            @Override
057            public Map<String, Object> getModelAttributes() {
058                    Map<String, Object> attributes = new HashMap<String, Object>();
059    
060                    attributes.put("mvccVersion", getMvccVersion());
061                    attributes.put("uuid", getUuid());
062                    attributes.put("userNotificationEventId", getUserNotificationEventId());
063                    attributes.put("companyId", getCompanyId());
064                    attributes.put("userId", getUserId());
065                    attributes.put("type", getType());
066                    attributes.put("timestamp", getTimestamp());
067                    attributes.put("deliveryType", getDeliveryType());
068                    attributes.put("deliverBy", getDeliverBy());
069                    attributes.put("delivered", getDelivered());
070                    attributes.put("payload", getPayload());
071                    attributes.put("actionRequired", getActionRequired());
072                    attributes.put("archived", getArchived());
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                    String uuid = (String)attributes.get("uuid");
086    
087                    if (uuid != null) {
088                            setUuid(uuid);
089                    }
090    
091                    Long userNotificationEventId = (Long)attributes.get(
092                                    "userNotificationEventId");
093    
094                    if (userNotificationEventId != null) {
095                            setUserNotificationEventId(userNotificationEventId);
096                    }
097    
098                    Long companyId = (Long)attributes.get("companyId");
099    
100                    if (companyId != null) {
101                            setCompanyId(companyId);
102                    }
103    
104                    Long userId = (Long)attributes.get("userId");
105    
106                    if (userId != null) {
107                            setUserId(userId);
108                    }
109    
110                    String type = (String)attributes.get("type");
111    
112                    if (type != null) {
113                            setType(type);
114                    }
115    
116                    Long timestamp = (Long)attributes.get("timestamp");
117    
118                    if (timestamp != null) {
119                            setTimestamp(timestamp);
120                    }
121    
122                    Integer deliveryType = (Integer)attributes.get("deliveryType");
123    
124                    if (deliveryType != null) {
125                            setDeliveryType(deliveryType);
126                    }
127    
128                    Long deliverBy = (Long)attributes.get("deliverBy");
129    
130                    if (deliverBy != null) {
131                            setDeliverBy(deliverBy);
132                    }
133    
134                    Boolean delivered = (Boolean)attributes.get("delivered");
135    
136                    if (delivered != null) {
137                            setDelivered(delivered);
138                    }
139    
140                    String payload = (String)attributes.get("payload");
141    
142                    if (payload != null) {
143                            setPayload(payload);
144                    }
145    
146                    Boolean actionRequired = (Boolean)attributes.get("actionRequired");
147    
148                    if (actionRequired != null) {
149                            setActionRequired(actionRequired);
150                    }
151    
152                    Boolean archived = (Boolean)attributes.get("archived");
153    
154                    if (archived != null) {
155                            setArchived(archived);
156                    }
157            }
158    
159            @Override
160            public CacheModel<UserNotificationEvent> toCacheModel() {
161                    return _userNotificationEvent.toCacheModel();
162            }
163    
164            @Override
165            public UserNotificationEvent toEscapedModel() {
166                    return new UserNotificationEventWrapper(_userNotificationEvent.toEscapedModel());
167            }
168    
169            @Override
170            public UserNotificationEvent toUnescapedModel() {
171                    return new UserNotificationEventWrapper(_userNotificationEvent.toUnescapedModel());
172            }
173    
174            /**
175            * Returns the action required of this user notification event.
176            *
177            * @return the action required of this user notification event
178            */
179            @Override
180            public boolean getActionRequired() {
181                    return _userNotificationEvent.getActionRequired();
182            }
183    
184            /**
185            * Returns the archived of this user notification event.
186            *
187            * @return the archived of this user notification event
188            */
189            @Override
190            public boolean getArchived() {
191                    return _userNotificationEvent.getArchived();
192            }
193    
194            /**
195            * Returns the delivered of this user notification event.
196            *
197            * @return the delivered of this user notification event
198            */
199            @Override
200            public boolean getDelivered() {
201                    return _userNotificationEvent.getDelivered();
202            }
203    
204            /**
205            * Returns <code>true</code> if this user notification event is action required.
206            *
207            * @return <code>true</code> if this user notification event is action required; <code>false</code> otherwise
208            */
209            @Override
210            public boolean isActionRequired() {
211                    return _userNotificationEvent.isActionRequired();
212            }
213    
214            /**
215            * Returns <code>true</code> if this user notification event is archived.
216            *
217            * @return <code>true</code> if this user notification event is archived; <code>false</code> otherwise
218            */
219            @Override
220            public boolean isArchived() {
221                    return _userNotificationEvent.isArchived();
222            }
223    
224            @Override
225            public boolean isCachedModel() {
226                    return _userNotificationEvent.isCachedModel();
227            }
228    
229            /**
230            * Returns <code>true</code> if this user notification event is delivered.
231            *
232            * @return <code>true</code> if this user notification event is delivered; <code>false</code> otherwise
233            */
234            @Override
235            public boolean isDelivered() {
236                    return _userNotificationEvent.isDelivered();
237            }
238    
239            @Override
240            public boolean isEscapedModel() {
241                    return _userNotificationEvent.isEscapedModel();
242            }
243    
244            @Override
245            public boolean isNew() {
246                    return _userNotificationEvent.isNew();
247            }
248    
249            @Override
250            public ExpandoBridge getExpandoBridge() {
251                    return _userNotificationEvent.getExpandoBridge();
252            }
253    
254            @Override
255            public int compareTo(UserNotificationEvent userNotificationEvent) {
256                    return _userNotificationEvent.compareTo(userNotificationEvent);
257            }
258    
259            /**
260            * Returns the delivery type of this user notification event.
261            *
262            * @return the delivery type of this user notification event
263            */
264            @Override
265            public int getDeliveryType() {
266                    return _userNotificationEvent.getDeliveryType();
267            }
268    
269            @Override
270            public int hashCode() {
271                    return _userNotificationEvent.hashCode();
272            }
273    
274            @Override
275            public Serializable getPrimaryKeyObj() {
276                    return _userNotificationEvent.getPrimaryKeyObj();
277            }
278    
279            @Override
280            public java.lang.Object clone() {
281                    return new UserNotificationEventWrapper((UserNotificationEvent)_userNotificationEvent.clone());
282            }
283    
284            /**
285            * Returns the payload of this user notification event.
286            *
287            * @return the payload of this user notification event
288            */
289            @Override
290            public java.lang.String getPayload() {
291                    return _userNotificationEvent.getPayload();
292            }
293    
294            /**
295            * Returns the type of this user notification event.
296            *
297            * @return the type of this user notification event
298            */
299            @Override
300            public java.lang.String getType() {
301                    return _userNotificationEvent.getType();
302            }
303    
304            /**
305            * Returns the user uuid of this user notification event.
306            *
307            * @return the user uuid of this user notification event
308            */
309            @Override
310            public java.lang.String getUserUuid() {
311                    return _userNotificationEvent.getUserUuid();
312            }
313    
314            /**
315            * Returns the uuid of this user notification event.
316            *
317            * @return the uuid of this user notification event
318            */
319            @Override
320            public java.lang.String getUuid() {
321                    return _userNotificationEvent.getUuid();
322            }
323    
324            @Override
325            public java.lang.String toString() {
326                    return _userNotificationEvent.toString();
327            }
328    
329            @Override
330            public java.lang.String toXmlString() {
331                    return _userNotificationEvent.toXmlString();
332            }
333    
334            /**
335            * Returns the company ID of this user notification event.
336            *
337            * @return the company ID of this user notification event
338            */
339            @Override
340            public long getCompanyId() {
341                    return _userNotificationEvent.getCompanyId();
342            }
343    
344            /**
345            * Returns the deliver by of this user notification event.
346            *
347            * @return the deliver by of this user notification event
348            */
349            @Override
350            public long getDeliverBy() {
351                    return _userNotificationEvent.getDeliverBy();
352            }
353    
354            /**
355            * Returns the mvcc version of this user notification event.
356            *
357            * @return the mvcc version of this user notification event
358            */
359            @Override
360            public long getMvccVersion() {
361                    return _userNotificationEvent.getMvccVersion();
362            }
363    
364            /**
365            * Returns the primary key of this user notification event.
366            *
367            * @return the primary key of this user notification event
368            */
369            @Override
370            public long getPrimaryKey() {
371                    return _userNotificationEvent.getPrimaryKey();
372            }
373    
374            /**
375            * Returns the timestamp of this user notification event.
376            *
377            * @return the timestamp of this user notification event
378            */
379            @Override
380            public long getTimestamp() {
381                    return _userNotificationEvent.getTimestamp();
382            }
383    
384            /**
385            * Returns the user ID of this user notification event.
386            *
387            * @return the user ID of this user notification event
388            */
389            @Override
390            public long getUserId() {
391                    return _userNotificationEvent.getUserId();
392            }
393    
394            /**
395            * Returns the user notification event ID of this user notification event.
396            *
397            * @return the user notification event ID of this user notification event
398            */
399            @Override
400            public long getUserNotificationEventId() {
401                    return _userNotificationEvent.getUserNotificationEventId();
402            }
403    
404            @Override
405            public void persist() {
406                    _userNotificationEvent.persist();
407            }
408    
409            /**
410            * Sets whether this user notification event is action required.
411            *
412            * @param actionRequired the action required of this user notification event
413            */
414            @Override
415            public void setActionRequired(boolean actionRequired) {
416                    _userNotificationEvent.setActionRequired(actionRequired);
417            }
418    
419            /**
420            * Sets whether this user notification event is archived.
421            *
422            * @param archived the archived of this user notification event
423            */
424            @Override
425            public void setArchived(boolean archived) {
426                    _userNotificationEvent.setArchived(archived);
427            }
428    
429            @Override
430            public void setCachedModel(boolean cachedModel) {
431                    _userNotificationEvent.setCachedModel(cachedModel);
432            }
433    
434            /**
435            * Sets the company ID of this user notification event.
436            *
437            * @param companyId the company ID of this user notification event
438            */
439            @Override
440            public void setCompanyId(long companyId) {
441                    _userNotificationEvent.setCompanyId(companyId);
442            }
443    
444            /**
445            * Sets the deliver by of this user notification event.
446            *
447            * @param deliverBy the deliver by of this user notification event
448            */
449            @Override
450            public void setDeliverBy(long deliverBy) {
451                    _userNotificationEvent.setDeliverBy(deliverBy);
452            }
453    
454            /**
455            * Sets whether this user notification event is delivered.
456            *
457            * @param delivered the delivered of this user notification event
458            */
459            @Override
460            public void setDelivered(boolean delivered) {
461                    _userNotificationEvent.setDelivered(delivered);
462            }
463    
464            /**
465            * Sets the delivery type of this user notification event.
466            *
467            * @param deliveryType the delivery type of this user notification event
468            */
469            @Override
470            public void setDeliveryType(int deliveryType) {
471                    _userNotificationEvent.setDeliveryType(deliveryType);
472            }
473    
474            @Override
475            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
476                    _userNotificationEvent.setExpandoBridgeAttributes(baseModel);
477            }
478    
479            @Override
480            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
481                    _userNotificationEvent.setExpandoBridgeAttributes(expandoBridge);
482            }
483    
484            @Override
485            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
486                    _userNotificationEvent.setExpandoBridgeAttributes(serviceContext);
487            }
488    
489            /**
490            * Sets the mvcc version of this user notification event.
491            *
492            * @param mvccVersion the mvcc version of this user notification event
493            */
494            @Override
495            public void setMvccVersion(long mvccVersion) {
496                    _userNotificationEvent.setMvccVersion(mvccVersion);
497            }
498    
499            @Override
500            public void setNew(boolean n) {
501                    _userNotificationEvent.setNew(n);
502            }
503    
504            /**
505            * Sets the payload of this user notification event.
506            *
507            * @param payload the payload of this user notification event
508            */
509            @Override
510            public void setPayload(java.lang.String payload) {
511                    _userNotificationEvent.setPayload(payload);
512            }
513    
514            /**
515            * Sets the primary key of this user notification event.
516            *
517            * @param primaryKey the primary key of this user notification event
518            */
519            @Override
520            public void setPrimaryKey(long primaryKey) {
521                    _userNotificationEvent.setPrimaryKey(primaryKey);
522            }
523    
524            @Override
525            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
526                    _userNotificationEvent.setPrimaryKeyObj(primaryKeyObj);
527            }
528    
529            /**
530            * Sets the timestamp of this user notification event.
531            *
532            * @param timestamp the timestamp of this user notification event
533            */
534            @Override
535            public void setTimestamp(long timestamp) {
536                    _userNotificationEvent.setTimestamp(timestamp);
537            }
538    
539            /**
540            * Sets the type of this user notification event.
541            *
542            * @param type the type of this user notification event
543            */
544            @Override
545            public void setType(java.lang.String type) {
546                    _userNotificationEvent.setType(type);
547            }
548    
549            /**
550            * Sets the user ID of this user notification event.
551            *
552            * @param userId the user ID of this user notification event
553            */
554            @Override
555            public void setUserId(long userId) {
556                    _userNotificationEvent.setUserId(userId);
557            }
558    
559            /**
560            * Sets the user notification event ID of this user notification event.
561            *
562            * @param userNotificationEventId the user notification event ID of this user notification event
563            */
564            @Override
565            public void setUserNotificationEventId(long userNotificationEventId) {
566                    _userNotificationEvent.setUserNotificationEventId(userNotificationEventId);
567            }
568    
569            /**
570            * Sets the user uuid of this user notification event.
571            *
572            * @param userUuid the user uuid of this user notification event
573            */
574            @Override
575            public void setUserUuid(java.lang.String userUuid) {
576                    _userNotificationEvent.setUserUuid(userUuid);
577            }
578    
579            /**
580            * Sets the uuid of this user notification event.
581            *
582            * @param uuid the uuid of this user notification event
583            */
584            @Override
585            public void setUuid(java.lang.String uuid) {
586                    _userNotificationEvent.setUuid(uuid);
587            }
588    
589            @Override
590            public boolean equals(Object obj) {
591                    if (this == obj) {
592                            return true;
593                    }
594    
595                    if (!(obj instanceof UserNotificationEventWrapper)) {
596                            return false;
597                    }
598    
599                    UserNotificationEventWrapper userNotificationEventWrapper = (UserNotificationEventWrapper)obj;
600    
601                    if (Objects.equals(_userNotificationEvent,
602                                            userNotificationEventWrapper._userNotificationEvent)) {
603                            return true;
604                    }
605    
606                    return false;
607            }
608    
609            @Override
610            public UserNotificationEvent getWrappedModel() {
611                    return _userNotificationEvent;
612            }
613    
614            @Override
615            public boolean isEntityCacheEnabled() {
616                    return _userNotificationEvent.isEntityCacheEnabled();
617            }
618    
619            @Override
620            public boolean isFinderCacheEnabled() {
621                    return _userNotificationEvent.isFinderCacheEnabled();
622            }
623    
624            @Override
625            public void resetOriginalValues() {
626                    _userNotificationEvent.resetOriginalValues();
627            }
628    
629            private final UserNotificationEvent _userNotificationEvent;
630    }