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