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