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