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