001
014
015 package com.liferay.portal.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018
019 import java.util.Date;
020 import java.util.HashMap;
021 import java.util.Map;
022
023
032 public class AddressWrapper implements Address, ModelWrapper<Address> {
033 public AddressWrapper(Address address) {
034 _address = address;
035 }
036
037 public Class<?> getModelClass() {
038 return Address.class;
039 }
040
041 public String getModelClassName() {
042 return Address.class.getName();
043 }
044
045 public Map<String, Object> getModelAttributes() {
046 Map<String, Object> attributes = new HashMap<String, Object>();
047
048 attributes.put("addressId", getAddressId());
049 attributes.put("companyId", getCompanyId());
050 attributes.put("userId", getUserId());
051 attributes.put("userName", getUserName());
052 attributes.put("createDate", getCreateDate());
053 attributes.put("modifiedDate", getModifiedDate());
054 attributes.put("classNameId", getClassNameId());
055 attributes.put("classPK", getClassPK());
056 attributes.put("street1", getStreet1());
057 attributes.put("street2", getStreet2());
058 attributes.put("street3", getStreet3());
059 attributes.put("city", getCity());
060 attributes.put("zip", getZip());
061 attributes.put("regionId", getRegionId());
062 attributes.put("countryId", getCountryId());
063 attributes.put("typeId", getTypeId());
064 attributes.put("mailing", getMailing());
065 attributes.put("primary", getPrimary());
066
067 return attributes;
068 }
069
070 public void setModelAttributes(Map<String, Object> attributes) {
071 Long addressId = (Long)attributes.get("addressId");
072
073 if (addressId != null) {
074 setAddressId(addressId);
075 }
076
077 Long companyId = (Long)attributes.get("companyId");
078
079 if (companyId != null) {
080 setCompanyId(companyId);
081 }
082
083 Long userId = (Long)attributes.get("userId");
084
085 if (userId != null) {
086 setUserId(userId);
087 }
088
089 String userName = (String)attributes.get("userName");
090
091 if (userName != null) {
092 setUserName(userName);
093 }
094
095 Date createDate = (Date)attributes.get("createDate");
096
097 if (createDate != null) {
098 setCreateDate(createDate);
099 }
100
101 Date modifiedDate = (Date)attributes.get("modifiedDate");
102
103 if (modifiedDate != null) {
104 setModifiedDate(modifiedDate);
105 }
106
107 Long classNameId = (Long)attributes.get("classNameId");
108
109 if (classNameId != null) {
110 setClassNameId(classNameId);
111 }
112
113 Long classPK = (Long)attributes.get("classPK");
114
115 if (classPK != null) {
116 setClassPK(classPK);
117 }
118
119 String street1 = (String)attributes.get("street1");
120
121 if (street1 != null) {
122 setStreet1(street1);
123 }
124
125 String street2 = (String)attributes.get("street2");
126
127 if (street2 != null) {
128 setStreet2(street2);
129 }
130
131 String street3 = (String)attributes.get("street3");
132
133 if (street3 != null) {
134 setStreet3(street3);
135 }
136
137 String city = (String)attributes.get("city");
138
139 if (city != null) {
140 setCity(city);
141 }
142
143 String zip = (String)attributes.get("zip");
144
145 if (zip != null) {
146 setZip(zip);
147 }
148
149 Long regionId = (Long)attributes.get("regionId");
150
151 if (regionId != null) {
152 setRegionId(regionId);
153 }
154
155 Long countryId = (Long)attributes.get("countryId");
156
157 if (countryId != null) {
158 setCountryId(countryId);
159 }
160
161 Integer typeId = (Integer)attributes.get("typeId");
162
163 if (typeId != null) {
164 setTypeId(typeId);
165 }
166
167 Boolean mailing = (Boolean)attributes.get("mailing");
168
169 if (mailing != null) {
170 setMailing(mailing);
171 }
172
173 Boolean primary = (Boolean)attributes.get("primary");
174
175 if (primary != null) {
176 setPrimary(primary);
177 }
178 }
179
180
185 public long getPrimaryKey() {
186 return _address.getPrimaryKey();
187 }
188
189
194 public void setPrimaryKey(long primaryKey) {
195 _address.setPrimaryKey(primaryKey);
196 }
197
198
203 public long getAddressId() {
204 return _address.getAddressId();
205 }
206
207
212 public void setAddressId(long addressId) {
213 _address.setAddressId(addressId);
214 }
215
216
221 public long getCompanyId() {
222 return _address.getCompanyId();
223 }
224
225
230 public void setCompanyId(long companyId) {
231 _address.setCompanyId(companyId);
232 }
233
234
239 public long getUserId() {
240 return _address.getUserId();
241 }
242
243
248 public void setUserId(long userId) {
249 _address.setUserId(userId);
250 }
251
252
258 public java.lang.String getUserUuid()
259 throws com.liferay.portal.kernel.exception.SystemException {
260 return _address.getUserUuid();
261 }
262
263
268 public void setUserUuid(java.lang.String userUuid) {
269 _address.setUserUuid(userUuid);
270 }
271
272
277 public java.lang.String getUserName() {
278 return _address.getUserName();
279 }
280
281
286 public void setUserName(java.lang.String userName) {
287 _address.setUserName(userName);
288 }
289
290
295 public java.util.Date getCreateDate() {
296 return _address.getCreateDate();
297 }
298
299
304 public void setCreateDate(java.util.Date createDate) {
305 _address.setCreateDate(createDate);
306 }
307
308
313 public java.util.Date getModifiedDate() {
314 return _address.getModifiedDate();
315 }
316
317
322 public void setModifiedDate(java.util.Date modifiedDate) {
323 _address.setModifiedDate(modifiedDate);
324 }
325
326
331 public java.lang.String getClassName() {
332 return _address.getClassName();
333 }
334
335 public void setClassName(java.lang.String className) {
336 _address.setClassName(className);
337 }
338
339
344 public long getClassNameId() {
345 return _address.getClassNameId();
346 }
347
348
353 public void setClassNameId(long classNameId) {
354 _address.setClassNameId(classNameId);
355 }
356
357
362 public long getClassPK() {
363 return _address.getClassPK();
364 }
365
366
371 public void setClassPK(long classPK) {
372 _address.setClassPK(classPK);
373 }
374
375
380 public java.lang.String getStreet1() {
381 return _address.getStreet1();
382 }
383
384
389 public void setStreet1(java.lang.String street1) {
390 _address.setStreet1(street1);
391 }
392
393
398 public java.lang.String getStreet2() {
399 return _address.getStreet2();
400 }
401
402
407 public void setStreet2(java.lang.String street2) {
408 _address.setStreet2(street2);
409 }
410
411
416 public java.lang.String getStreet3() {
417 return _address.getStreet3();
418 }
419
420
425 public void setStreet3(java.lang.String street3) {
426 _address.setStreet3(street3);
427 }
428
429
434 public java.lang.String getCity() {
435 return _address.getCity();
436 }
437
438
443 public void setCity(java.lang.String city) {
444 _address.setCity(city);
445 }
446
447
452 public java.lang.String getZip() {
453 return _address.getZip();
454 }
455
456
461 public void setZip(java.lang.String zip) {
462 _address.setZip(zip);
463 }
464
465
470 public long getRegionId() {
471 return _address.getRegionId();
472 }
473
474
479 public void setRegionId(long regionId) {
480 _address.setRegionId(regionId);
481 }
482
483
488 public long getCountryId() {
489 return _address.getCountryId();
490 }
491
492
497 public void setCountryId(long countryId) {
498 _address.setCountryId(countryId);
499 }
500
501
506 public int getTypeId() {
507 return _address.getTypeId();
508 }
509
510
515 public void setTypeId(int typeId) {
516 _address.setTypeId(typeId);
517 }
518
519
524 public boolean getMailing() {
525 return _address.getMailing();
526 }
527
528
533 public boolean isMailing() {
534 return _address.isMailing();
535 }
536
537
542 public void setMailing(boolean mailing) {
543 _address.setMailing(mailing);
544 }
545
546
551 public boolean getPrimary() {
552 return _address.getPrimary();
553 }
554
555
560 public boolean isPrimary() {
561 return _address.isPrimary();
562 }
563
564
569 public void setPrimary(boolean primary) {
570 _address.setPrimary(primary);
571 }
572
573 public boolean isNew() {
574 return _address.isNew();
575 }
576
577 public void setNew(boolean n) {
578 _address.setNew(n);
579 }
580
581 public boolean isCachedModel() {
582 return _address.isCachedModel();
583 }
584
585 public void setCachedModel(boolean cachedModel) {
586 _address.setCachedModel(cachedModel);
587 }
588
589 public boolean isEscapedModel() {
590 return _address.isEscapedModel();
591 }
592
593 public java.io.Serializable getPrimaryKeyObj() {
594 return _address.getPrimaryKeyObj();
595 }
596
597 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
598 _address.setPrimaryKeyObj(primaryKeyObj);
599 }
600
601 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
602 return _address.getExpandoBridge();
603 }
604
605 public void setExpandoBridgeAttributes(
606 com.liferay.portal.service.ServiceContext serviceContext) {
607 _address.setExpandoBridgeAttributes(serviceContext);
608 }
609
610 @Override
611 public java.lang.Object clone() {
612 return new AddressWrapper((Address)_address.clone());
613 }
614
615 public int compareTo(com.liferay.portal.model.Address address) {
616 return _address.compareTo(address);
617 }
618
619 @Override
620 public int hashCode() {
621 return _address.hashCode();
622 }
623
624 public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Address> toCacheModel() {
625 return _address.toCacheModel();
626 }
627
628 public com.liferay.portal.model.Address toEscapedModel() {
629 return new AddressWrapper(_address.toEscapedModel());
630 }
631
632 public com.liferay.portal.model.Address toUnescapedModel() {
633 return new AddressWrapper(_address.toUnescapedModel());
634 }
635
636 @Override
637 public java.lang.String toString() {
638 return _address.toString();
639 }
640
641 public java.lang.String toXmlString() {
642 return _address.toXmlString();
643 }
644
645 public void persist()
646 throws com.liferay.portal.kernel.exception.SystemException {
647 _address.persist();
648 }
649
650 public com.liferay.portal.model.Country getCountry() {
651 return _address.getCountry();
652 }
653
654 public com.liferay.portal.model.Region getRegion() {
655 return _address.getRegion();
656 }
657
658 public com.liferay.portal.model.ListType getType() {
659 return _address.getType();
660 }
661
662 @Override
663 public boolean equals(Object obj) {
664 if (this == obj) {
665 return true;
666 }
667
668 if (!(obj instanceof AddressWrapper)) {
669 return false;
670 }
671
672 AddressWrapper addressWrapper = (AddressWrapper)obj;
673
674 if (Validator.equals(_address, addressWrapper._address)) {
675 return true;
676 }
677
678 return false;
679 }
680
681
684 public Address getWrappedAddress() {
685 return _address;
686 }
687
688 public Address getWrappedModel() {
689 return _address;
690 }
691
692 public void resetOriginalValues() {
693 _address.resetOriginalValues();
694 }
695
696 private Address _address;
697 }