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