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.announcements.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.model.ModelWrapper;
022    import com.liferay.portal.kernel.service.ServiceContext;
023    import com.liferay.portal.kernel.util.Validator;
024    
025    import java.io.Serializable;
026    
027    import java.util.HashMap;
028    import java.util.Map;
029    
030    /**
031     * <p>
032     * This class is a wrapper for {@link AnnouncementsDelivery}.
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see AnnouncementsDelivery
037     * @generated
038     */
039    @ProviderType
040    public class AnnouncementsDeliveryWrapper implements AnnouncementsDelivery,
041            ModelWrapper<AnnouncementsDelivery> {
042            public AnnouncementsDeliveryWrapper(
043                    AnnouncementsDelivery announcementsDelivery) {
044                    _announcementsDelivery = announcementsDelivery;
045            }
046    
047            @Override
048            public Class<?> getModelClass() {
049                    return AnnouncementsDelivery.class;
050            }
051    
052            @Override
053            public String getModelClassName() {
054                    return AnnouncementsDelivery.class.getName();
055            }
056    
057            @Override
058            public Map<String, Object> getModelAttributes() {
059                    Map<String, Object> attributes = new HashMap<String, Object>();
060    
061                    attributes.put("deliveryId", getDeliveryId());
062                    attributes.put("companyId", getCompanyId());
063                    attributes.put("userId", getUserId());
064                    attributes.put("type", getType());
065                    attributes.put("email", getEmail());
066                    attributes.put("sms", getSms());
067                    attributes.put("website", getWebsite());
068    
069                    return attributes;
070            }
071    
072            @Override
073            public void setModelAttributes(Map<String, Object> attributes) {
074                    Long deliveryId = (Long)attributes.get("deliveryId");
075    
076                    if (deliveryId != null) {
077                            setDeliveryId(deliveryId);
078                    }
079    
080                    Long companyId = (Long)attributes.get("companyId");
081    
082                    if (companyId != null) {
083                            setCompanyId(companyId);
084                    }
085    
086                    Long userId = (Long)attributes.get("userId");
087    
088                    if (userId != null) {
089                            setUserId(userId);
090                    }
091    
092                    String type = (String)attributes.get("type");
093    
094                    if (type != null) {
095                            setType(type);
096                    }
097    
098                    Boolean email = (Boolean)attributes.get("email");
099    
100                    if (email != null) {
101                            setEmail(email);
102                    }
103    
104                    Boolean sms = (Boolean)attributes.get("sms");
105    
106                    if (sms != null) {
107                            setSms(sms);
108                    }
109    
110                    Boolean website = (Boolean)attributes.get("website");
111    
112                    if (website != null) {
113                            setWebsite(website);
114                    }
115            }
116    
117            @Override
118            public java.lang.Object clone() {
119                    return new AnnouncementsDeliveryWrapper((AnnouncementsDelivery)_announcementsDelivery.clone());
120            }
121    
122            @Override
123            public int compareTo(
124                    com.liferay.announcements.kernel.model.AnnouncementsDelivery announcementsDelivery) {
125                    return _announcementsDelivery.compareTo(announcementsDelivery);
126            }
127    
128            /**
129            * Returns the company ID of this announcements delivery.
130            *
131            * @return the company ID of this announcements delivery
132            */
133            @Override
134            public long getCompanyId() {
135                    return _announcementsDelivery.getCompanyId();
136            }
137    
138            /**
139            * Returns the delivery ID of this announcements delivery.
140            *
141            * @return the delivery ID of this announcements delivery
142            */
143            @Override
144            public long getDeliveryId() {
145                    return _announcementsDelivery.getDeliveryId();
146            }
147    
148            /**
149            * Returns the email of this announcements delivery.
150            *
151            * @return the email of this announcements delivery
152            */
153            @Override
154            public boolean getEmail() {
155                    return _announcementsDelivery.getEmail();
156            }
157    
158            @Override
159            public ExpandoBridge getExpandoBridge() {
160                    return _announcementsDelivery.getExpandoBridge();
161            }
162    
163            /**
164            * Returns the primary key of this announcements delivery.
165            *
166            * @return the primary key of this announcements delivery
167            */
168            @Override
169            public long getPrimaryKey() {
170                    return _announcementsDelivery.getPrimaryKey();
171            }
172    
173            @Override
174            public Serializable getPrimaryKeyObj() {
175                    return _announcementsDelivery.getPrimaryKeyObj();
176            }
177    
178            /**
179            * Returns the sms of this announcements delivery.
180            *
181            * @return the sms of this announcements delivery
182            */
183            @Override
184            public boolean getSms() {
185                    return _announcementsDelivery.getSms();
186            }
187    
188            /**
189            * Returns the type of this announcements delivery.
190            *
191            * @return the type of this announcements delivery
192            */
193            @Override
194            public java.lang.String getType() {
195                    return _announcementsDelivery.getType();
196            }
197    
198            /**
199            * Returns the user ID of this announcements delivery.
200            *
201            * @return the user ID of this announcements delivery
202            */
203            @Override
204            public long getUserId() {
205                    return _announcementsDelivery.getUserId();
206            }
207    
208            /**
209            * Returns the user uuid of this announcements delivery.
210            *
211            * @return the user uuid of this announcements delivery
212            */
213            @Override
214            public java.lang.String getUserUuid() {
215                    return _announcementsDelivery.getUserUuid();
216            }
217    
218            /**
219            * Returns the website of this announcements delivery.
220            *
221            * @return the website of this announcements delivery
222            */
223            @Override
224            public boolean getWebsite() {
225                    return _announcementsDelivery.getWebsite();
226            }
227    
228            @Override
229            public int hashCode() {
230                    return _announcementsDelivery.hashCode();
231            }
232    
233            @Override
234            public boolean isCachedModel() {
235                    return _announcementsDelivery.isCachedModel();
236            }
237    
238            /**
239            * Returns <code>true</code> if this announcements delivery is email.
240            *
241            * @return <code>true</code> if this announcements delivery is email; <code>false</code> otherwise
242            */
243            @Override
244            public boolean isEmail() {
245                    return _announcementsDelivery.isEmail();
246            }
247    
248            @Override
249            public boolean isEscapedModel() {
250                    return _announcementsDelivery.isEscapedModel();
251            }
252    
253            @Override
254            public boolean isNew() {
255                    return _announcementsDelivery.isNew();
256            }
257    
258            /**
259            * Returns <code>true</code> if this announcements delivery is sms.
260            *
261            * @return <code>true</code> if this announcements delivery is sms; <code>false</code> otherwise
262            */
263            @Override
264            public boolean isSms() {
265                    return _announcementsDelivery.isSms();
266            }
267    
268            /**
269            * Returns <code>true</code> if this announcements delivery is website.
270            *
271            * @return <code>true</code> if this announcements delivery is website; <code>false</code> otherwise
272            */
273            @Override
274            public boolean isWebsite() {
275                    return _announcementsDelivery.isWebsite();
276            }
277    
278            @Override
279            public void persist() {
280                    _announcementsDelivery.persist();
281            }
282    
283            @Override
284            public void setCachedModel(boolean cachedModel) {
285                    _announcementsDelivery.setCachedModel(cachedModel);
286            }
287    
288            /**
289            * Sets the company ID of this announcements delivery.
290            *
291            * @param companyId the company ID of this announcements delivery
292            */
293            @Override
294            public void setCompanyId(long companyId) {
295                    _announcementsDelivery.setCompanyId(companyId);
296            }
297    
298            /**
299            * Sets the delivery ID of this announcements delivery.
300            *
301            * @param deliveryId the delivery ID of this announcements delivery
302            */
303            @Override
304            public void setDeliveryId(long deliveryId) {
305                    _announcementsDelivery.setDeliveryId(deliveryId);
306            }
307    
308            /**
309            * Sets whether this announcements delivery is email.
310            *
311            * @param email the email of this announcements delivery
312            */
313            @Override
314            public void setEmail(boolean email) {
315                    _announcementsDelivery.setEmail(email);
316            }
317    
318            @Override
319            public void setExpandoBridgeAttributes(
320                    com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
321                    _announcementsDelivery.setExpandoBridgeAttributes(baseModel);
322            }
323    
324            @Override
325            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
326                    _announcementsDelivery.setExpandoBridgeAttributes(expandoBridge);
327            }
328    
329            @Override
330            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
331                    _announcementsDelivery.setExpandoBridgeAttributes(serviceContext);
332            }
333    
334            @Override
335            public void setNew(boolean n) {
336                    _announcementsDelivery.setNew(n);
337            }
338    
339            /**
340            * Sets the primary key of this announcements delivery.
341            *
342            * @param primaryKey the primary key of this announcements delivery
343            */
344            @Override
345            public void setPrimaryKey(long primaryKey) {
346                    _announcementsDelivery.setPrimaryKey(primaryKey);
347            }
348    
349            @Override
350            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
351                    _announcementsDelivery.setPrimaryKeyObj(primaryKeyObj);
352            }
353    
354            /**
355            * Sets whether this announcements delivery is sms.
356            *
357            * @param sms the sms of this announcements delivery
358            */
359            @Override
360            public void setSms(boolean sms) {
361                    _announcementsDelivery.setSms(sms);
362            }
363    
364            /**
365            * Sets the type of this announcements delivery.
366            *
367            * @param type the type of this announcements delivery
368            */
369            @Override
370            public void setType(java.lang.String type) {
371                    _announcementsDelivery.setType(type);
372            }
373    
374            /**
375            * Sets the user ID of this announcements delivery.
376            *
377            * @param userId the user ID of this announcements delivery
378            */
379            @Override
380            public void setUserId(long userId) {
381                    _announcementsDelivery.setUserId(userId);
382            }
383    
384            /**
385            * Sets the user uuid of this announcements delivery.
386            *
387            * @param userUuid the user uuid of this announcements delivery
388            */
389            @Override
390            public void setUserUuid(java.lang.String userUuid) {
391                    _announcementsDelivery.setUserUuid(userUuid);
392            }
393    
394            /**
395            * Sets whether this announcements delivery is website.
396            *
397            * @param website the website of this announcements delivery
398            */
399            @Override
400            public void setWebsite(boolean website) {
401                    _announcementsDelivery.setWebsite(website);
402            }
403    
404            @Override
405            public com.liferay.portal.kernel.model.CacheModel<com.liferay.announcements.kernel.model.AnnouncementsDelivery> toCacheModel() {
406                    return _announcementsDelivery.toCacheModel();
407            }
408    
409            @Override
410            public com.liferay.announcements.kernel.model.AnnouncementsDelivery toEscapedModel() {
411                    return new AnnouncementsDeliveryWrapper(_announcementsDelivery.toEscapedModel());
412            }
413    
414            @Override
415            public java.lang.String toString() {
416                    return _announcementsDelivery.toString();
417            }
418    
419            @Override
420            public com.liferay.announcements.kernel.model.AnnouncementsDelivery toUnescapedModel() {
421                    return new AnnouncementsDeliveryWrapper(_announcementsDelivery.toUnescapedModel());
422            }
423    
424            @Override
425            public java.lang.String toXmlString() {
426                    return _announcementsDelivery.toXmlString();
427            }
428    
429            @Override
430            public boolean equals(Object obj) {
431                    if (this == obj) {
432                            return true;
433                    }
434    
435                    if (!(obj instanceof AnnouncementsDeliveryWrapper)) {
436                            return false;
437                    }
438    
439                    AnnouncementsDeliveryWrapper announcementsDeliveryWrapper = (AnnouncementsDeliveryWrapper)obj;
440    
441                    if (Validator.equals(_announcementsDelivery,
442                                            announcementsDeliveryWrapper._announcementsDelivery)) {
443                            return true;
444                    }
445    
446                    return false;
447            }
448    
449            @Override
450            public AnnouncementsDelivery getWrappedModel() {
451                    return _announcementsDelivery;
452            }
453    
454            @Override
455            public boolean isEntityCacheEnabled() {
456                    return _announcementsDelivery.isEntityCacheEnabled();
457            }
458    
459            @Override
460            public boolean isFinderCacheEnabled() {
461                    return _announcementsDelivery.isFinderCacheEnabled();
462            }
463    
464            @Override
465            public void resetOriginalValues() {
466                    _announcementsDelivery.resetOriginalValues();
467            }
468    
469            private final AnnouncementsDelivery _announcementsDelivery;
470    }