001
014
015 package com.liferay.portal.model.impl;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.model.Address;
020 import com.liferay.portal.model.Country;
021 import com.liferay.portal.model.ListType;
022 import com.liferay.portal.model.Region;
023 import com.liferay.portal.service.CountryServiceUtil;
024 import com.liferay.portal.service.ListTypeServiceUtil;
025 import com.liferay.portal.service.RegionServiceUtil;
026
027
030 public class AddressImpl extends AddressModelImpl implements Address {
031
032 public AddressImpl() {
033 }
034
035 public Region getRegion() {
036 Region region = null;
037
038 try {
039 region = RegionServiceUtil.getRegion(getRegionId());
040 }
041 catch (Exception e) {
042 region = new RegionImpl();
043
044 _log.warn(e);
045 }
046
047 return region;
048 }
049
050 public Country getCountry() {
051 Country country = null;
052
053 try {
054 country = CountryServiceUtil.getCountry(getCountryId());
055 }
056 catch (Exception e) {
057 country = new CountryImpl();
058
059 _log.warn(e);
060 }
061
062 return country;
063 }
064
065 public ListType getType() {
066 ListType type = null;
067
068 try {
069 type = ListTypeServiceUtil.getListType(getTypeId());
070 }
071 catch (Exception e) {
072 type = new ListTypeImpl();
073
074 _log.warn(e);
075 }
076
077 return type;
078 }
079
080 private static Log _log = LogFactoryUtil.getLog(AddressImpl.class);
081
082 }