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