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