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