001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.lar.StagedModelType;
020    import com.liferay.portal.kernel.util.Validator;
021    
022    import java.util.Date;
023    import java.util.HashMap;
024    import java.util.Map;
025    
026    /**
027     * <p>
028     * This class is a wrapper for {@link EmailAddress}.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see EmailAddress
033     * @generated
034     */
035    @ProviderType
036    public class EmailAddressWrapper implements EmailAddress,
037            ModelWrapper<EmailAddress> {
038            public EmailAddressWrapper(EmailAddress emailAddress) {
039                    _emailAddress = emailAddress;
040            }
041    
042            @Override
043            public Class<?> getModelClass() {
044                    return EmailAddress.class;
045            }
046    
047            @Override
048            public String getModelClassName() {
049                    return EmailAddress.class.getName();
050            }
051    
052            @Override
053            public Map<String, Object> getModelAttributes() {
054                    Map<String, Object> attributes = new HashMap<String, Object>();
055    
056                    attributes.put("uuid", getUuid());
057                    attributes.put("emailAddressId", getEmailAddressId());
058                    attributes.put("companyId", getCompanyId());
059                    attributes.put("userId", getUserId());
060                    attributes.put("userName", getUserName());
061                    attributes.put("createDate", getCreateDate());
062                    attributes.put("modifiedDate", getModifiedDate());
063                    attributes.put("classNameId", getClassNameId());
064                    attributes.put("classPK", getClassPK());
065                    attributes.put("address", getAddress());
066                    attributes.put("typeId", getTypeId());
067                    attributes.put("primary", getPrimary());
068    
069                    return attributes;
070            }
071    
072            @Override
073            public void setModelAttributes(Map<String, Object> attributes) {
074                    String uuid = (String)attributes.get("uuid");
075    
076                    if (uuid != null) {
077                            setUuid(uuid);
078                    }
079    
080                    Long emailAddressId = (Long)attributes.get("emailAddressId");
081    
082                    if (emailAddressId != null) {
083                            setEmailAddressId(emailAddressId);
084                    }
085    
086                    Long companyId = (Long)attributes.get("companyId");
087    
088                    if (companyId != null) {
089                            setCompanyId(companyId);
090                    }
091    
092                    Long userId = (Long)attributes.get("userId");
093    
094                    if (userId != null) {
095                            setUserId(userId);
096                    }
097    
098                    String userName = (String)attributes.get("userName");
099    
100                    if (userName != null) {
101                            setUserName(userName);
102                    }
103    
104                    Date createDate = (Date)attributes.get("createDate");
105    
106                    if (createDate != null) {
107                            setCreateDate(createDate);
108                    }
109    
110                    Date modifiedDate = (Date)attributes.get("modifiedDate");
111    
112                    if (modifiedDate != null) {
113                            setModifiedDate(modifiedDate);
114                    }
115    
116                    Long classNameId = (Long)attributes.get("classNameId");
117    
118                    if (classNameId != null) {
119                            setClassNameId(classNameId);
120                    }
121    
122                    Long classPK = (Long)attributes.get("classPK");
123    
124                    if (classPK != null) {
125                            setClassPK(classPK);
126                    }
127    
128                    String address = (String)attributes.get("address");
129    
130                    if (address != null) {
131                            setAddress(address);
132                    }
133    
134                    Integer typeId = (Integer)attributes.get("typeId");
135    
136                    if (typeId != null) {
137                            setTypeId(typeId);
138                    }
139    
140                    Boolean primary = (Boolean)attributes.get("primary");
141    
142                    if (primary != null) {
143                            setPrimary(primary);
144                    }
145            }
146    
147            /**
148            * Returns the primary key of this email address.
149            *
150            * @return the primary key of this email address
151            */
152            @Override
153            public long getPrimaryKey() {
154                    return _emailAddress.getPrimaryKey();
155            }
156    
157            /**
158            * Sets the primary key of this email address.
159            *
160            * @param primaryKey the primary key of this email address
161            */
162            @Override
163            public void setPrimaryKey(long primaryKey) {
164                    _emailAddress.setPrimaryKey(primaryKey);
165            }
166    
167            /**
168            * Returns the uuid of this email address.
169            *
170            * @return the uuid of this email address
171            */
172            @Override
173            public java.lang.String getUuid() {
174                    return _emailAddress.getUuid();
175            }
176    
177            /**
178            * Sets the uuid of this email address.
179            *
180            * @param uuid the uuid of this email address
181            */
182            @Override
183            public void setUuid(java.lang.String uuid) {
184                    _emailAddress.setUuid(uuid);
185            }
186    
187            /**
188            * Returns the email address ID of this email address.
189            *
190            * @return the email address ID of this email address
191            */
192            @Override
193            public long getEmailAddressId() {
194                    return _emailAddress.getEmailAddressId();
195            }
196    
197            /**
198            * Sets the email address ID of this email address.
199            *
200            * @param emailAddressId the email address ID of this email address
201            */
202            @Override
203            public void setEmailAddressId(long emailAddressId) {
204                    _emailAddress.setEmailAddressId(emailAddressId);
205            }
206    
207            /**
208            * Returns the company ID of this email address.
209            *
210            * @return the company ID of this email address
211            */
212            @Override
213            public long getCompanyId() {
214                    return _emailAddress.getCompanyId();
215            }
216    
217            /**
218            * Sets the company ID of this email address.
219            *
220            * @param companyId the company ID of this email address
221            */
222            @Override
223            public void setCompanyId(long companyId) {
224                    _emailAddress.setCompanyId(companyId);
225            }
226    
227            /**
228            * Returns the user ID of this email address.
229            *
230            * @return the user ID of this email address
231            */
232            @Override
233            public long getUserId() {
234                    return _emailAddress.getUserId();
235            }
236    
237            /**
238            * Sets the user ID of this email address.
239            *
240            * @param userId the user ID of this email address
241            */
242            @Override
243            public void setUserId(long userId) {
244                    _emailAddress.setUserId(userId);
245            }
246    
247            /**
248            * Returns the user uuid of this email address.
249            *
250            * @return the user uuid of this email address
251            * @throws SystemException if a system exception occurred
252            */
253            @Override
254            public java.lang.String getUserUuid()
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    return _emailAddress.getUserUuid();
257            }
258    
259            /**
260            * Sets the user uuid of this email address.
261            *
262            * @param userUuid the user uuid of this email address
263            */
264            @Override
265            public void setUserUuid(java.lang.String userUuid) {
266                    _emailAddress.setUserUuid(userUuid);
267            }
268    
269            /**
270            * Returns the user name of this email address.
271            *
272            * @return the user name of this email address
273            */
274            @Override
275            public java.lang.String getUserName() {
276                    return _emailAddress.getUserName();
277            }
278    
279            /**
280            * Sets the user name of this email address.
281            *
282            * @param userName the user name of this email address
283            */
284            @Override
285            public void setUserName(java.lang.String userName) {
286                    _emailAddress.setUserName(userName);
287            }
288    
289            /**
290            * Returns the create date of this email address.
291            *
292            * @return the create date of this email address
293            */
294            @Override
295            public java.util.Date getCreateDate() {
296                    return _emailAddress.getCreateDate();
297            }
298    
299            /**
300            * Sets the create date of this email address.
301            *
302            * @param createDate the create date of this email address
303            */
304            @Override
305            public void setCreateDate(java.util.Date createDate) {
306                    _emailAddress.setCreateDate(createDate);
307            }
308    
309            /**
310            * Returns the modified date of this email address.
311            *
312            * @return the modified date of this email address
313            */
314            @Override
315            public java.util.Date getModifiedDate() {
316                    return _emailAddress.getModifiedDate();
317            }
318    
319            /**
320            * Sets the modified date of this email address.
321            *
322            * @param modifiedDate the modified date of this email address
323            */
324            @Override
325            public void setModifiedDate(java.util.Date modifiedDate) {
326                    _emailAddress.setModifiedDate(modifiedDate);
327            }
328    
329            /**
330            * Returns the fully qualified class name of this email address.
331            *
332            * @return the fully qualified class name of this email address
333            */
334            @Override
335            public java.lang.String getClassName() {
336                    return _emailAddress.getClassName();
337            }
338    
339            @Override
340            public void setClassName(java.lang.String className) {
341                    _emailAddress.setClassName(className);
342            }
343    
344            /**
345            * Returns the class name ID of this email address.
346            *
347            * @return the class name ID of this email address
348            */
349            @Override
350            public long getClassNameId() {
351                    return _emailAddress.getClassNameId();
352            }
353    
354            /**
355            * Sets the class name ID of this email address.
356            *
357            * @param classNameId the class name ID of this email address
358            */
359            @Override
360            public void setClassNameId(long classNameId) {
361                    _emailAddress.setClassNameId(classNameId);
362            }
363    
364            /**
365            * Returns the class p k of this email address.
366            *
367            * @return the class p k of this email address
368            */
369            @Override
370            public long getClassPK() {
371                    return _emailAddress.getClassPK();
372            }
373    
374            /**
375            * Sets the class p k of this email address.
376            *
377            * @param classPK the class p k of this email address
378            */
379            @Override
380            public void setClassPK(long classPK) {
381                    _emailAddress.setClassPK(classPK);
382            }
383    
384            /**
385            * Returns the address of this email address.
386            *
387            * @return the address of this email address
388            */
389            @Override
390            public java.lang.String getAddress() {
391                    return _emailAddress.getAddress();
392            }
393    
394            /**
395            * Sets the address of this email address.
396            *
397            * @param address the address of this email address
398            */
399            @Override
400            public void setAddress(java.lang.String address) {
401                    _emailAddress.setAddress(address);
402            }
403    
404            /**
405            * Returns the type ID of this email address.
406            *
407            * @return the type ID of this email address
408            */
409            @Override
410            public int getTypeId() {
411                    return _emailAddress.getTypeId();
412            }
413    
414            /**
415            * Sets the type ID of this email address.
416            *
417            * @param typeId the type ID of this email address
418            */
419            @Override
420            public void setTypeId(int typeId) {
421                    _emailAddress.setTypeId(typeId);
422            }
423    
424            /**
425            * Returns the primary of this email address.
426            *
427            * @return the primary of this email address
428            */
429            @Override
430            public boolean getPrimary() {
431                    return _emailAddress.getPrimary();
432            }
433    
434            /**
435            * Returns <code>true</code> if this email address is primary.
436            *
437            * @return <code>true</code> if this email address is primary; <code>false</code> otherwise
438            */
439            @Override
440            public boolean isPrimary() {
441                    return _emailAddress.isPrimary();
442            }
443    
444            /**
445            * Sets whether this email address is primary.
446            *
447            * @param primary the primary of this email address
448            */
449            @Override
450            public void setPrimary(boolean primary) {
451                    _emailAddress.setPrimary(primary);
452            }
453    
454            @Override
455            public boolean isNew() {
456                    return _emailAddress.isNew();
457            }
458    
459            @Override
460            public void setNew(boolean n) {
461                    _emailAddress.setNew(n);
462            }
463    
464            @Override
465            public boolean isCachedModel() {
466                    return _emailAddress.isCachedModel();
467            }
468    
469            @Override
470            public void setCachedModel(boolean cachedModel) {
471                    _emailAddress.setCachedModel(cachedModel);
472            }
473    
474            @Override
475            public boolean isEscapedModel() {
476                    return _emailAddress.isEscapedModel();
477            }
478    
479            @Override
480            public java.io.Serializable getPrimaryKeyObj() {
481                    return _emailAddress.getPrimaryKeyObj();
482            }
483    
484            @Override
485            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
486                    _emailAddress.setPrimaryKeyObj(primaryKeyObj);
487            }
488    
489            @Override
490            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
491                    return _emailAddress.getExpandoBridge();
492            }
493    
494            @Override
495            public void setExpandoBridgeAttributes(
496                    com.liferay.portal.model.BaseModel<?> baseModel) {
497                    _emailAddress.setExpandoBridgeAttributes(baseModel);
498            }
499    
500            @Override
501            public void setExpandoBridgeAttributes(
502                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
503                    _emailAddress.setExpandoBridgeAttributes(expandoBridge);
504            }
505    
506            @Override
507            public void setExpandoBridgeAttributes(
508                    com.liferay.portal.service.ServiceContext serviceContext) {
509                    _emailAddress.setExpandoBridgeAttributes(serviceContext);
510            }
511    
512            @Override
513            public java.lang.Object clone() {
514                    return new EmailAddressWrapper((EmailAddress)_emailAddress.clone());
515            }
516    
517            @Override
518            public int compareTo(com.liferay.portal.model.EmailAddress emailAddress) {
519                    return _emailAddress.compareTo(emailAddress);
520            }
521    
522            @Override
523            public int hashCode() {
524                    return _emailAddress.hashCode();
525            }
526    
527            @Override
528            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.EmailAddress> toCacheModel() {
529                    return _emailAddress.toCacheModel();
530            }
531    
532            @Override
533            public com.liferay.portal.model.EmailAddress toEscapedModel() {
534                    return new EmailAddressWrapper(_emailAddress.toEscapedModel());
535            }
536    
537            @Override
538            public com.liferay.portal.model.EmailAddress toUnescapedModel() {
539                    return new EmailAddressWrapper(_emailAddress.toUnescapedModel());
540            }
541    
542            @Override
543            public java.lang.String toString() {
544                    return _emailAddress.toString();
545            }
546    
547            @Override
548            public java.lang.String toXmlString() {
549                    return _emailAddress.toXmlString();
550            }
551    
552            @Override
553            public void persist()
554                    throws com.liferay.portal.kernel.exception.SystemException {
555                    _emailAddress.persist();
556            }
557    
558            @Override
559            public com.liferay.portal.model.ListType getType()
560                    throws com.liferay.portal.kernel.exception.PortalException,
561                            com.liferay.portal.kernel.exception.SystemException {
562                    return _emailAddress.getType();
563            }
564    
565            @Override
566            public boolean equals(Object obj) {
567                    if (this == obj) {
568                            return true;
569                    }
570    
571                    if (!(obj instanceof EmailAddressWrapper)) {
572                            return false;
573                    }
574    
575                    EmailAddressWrapper emailAddressWrapper = (EmailAddressWrapper)obj;
576    
577                    if (Validator.equals(_emailAddress, emailAddressWrapper._emailAddress)) {
578                            return true;
579                    }
580    
581                    return false;
582            }
583    
584            @Override
585            public StagedModelType getStagedModelType() {
586                    return _emailAddress.getStagedModelType();
587            }
588    
589            /**
590             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
591             */
592            public EmailAddress getWrappedEmailAddress() {
593                    return _emailAddress;
594            }
595    
596            @Override
597            public EmailAddress getWrappedModel() {
598                    return _emailAddress;
599            }
600    
601            @Override
602            public void resetOriginalValues() {
603                    _emailAddress.resetOriginalValues();
604            }
605    
606            private EmailAddress _emailAddress;
607    }