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