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