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