1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="AddressServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link AddressService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       AddressService
37   * @generated
38   */
39  public class AddressServiceUtil {
40      public static com.liferay.portal.model.Address addAddress(
41          java.lang.String className, long classPK, java.lang.String street1,
42          java.lang.String street2, java.lang.String street3,
43          java.lang.String city, java.lang.String zip, long regionId,
44          long countryId, int typeId, boolean mailing, boolean primary)
45          throws com.liferay.portal.kernel.exception.PortalException,
46              com.liferay.portal.kernel.exception.SystemException {
47          return getService()
48                     .addAddress(className, classPK, street1, street2, street3,
49              city, zip, regionId, countryId, typeId, mailing, primary);
50      }
51  
52      public static void deleteAddress(long addressId)
53          throws com.liferay.portal.kernel.exception.PortalException,
54              com.liferay.portal.kernel.exception.SystemException {
55          getService().deleteAddress(addressId);
56      }
57  
58      public static com.liferay.portal.model.Address getAddress(long addressId)
59          throws com.liferay.portal.kernel.exception.PortalException,
60              com.liferay.portal.kernel.exception.SystemException {
61          return getService().getAddress(addressId);
62      }
63  
64      public static java.util.List<com.liferay.portal.model.Address> getAddresses(
65          java.lang.String className, long classPK)
66          throws com.liferay.portal.kernel.exception.PortalException,
67              com.liferay.portal.kernel.exception.SystemException {
68          return getService().getAddresses(className, classPK);
69      }
70  
71      public static com.liferay.portal.model.Address updateAddress(
72          long addressId, java.lang.String street1, java.lang.String street2,
73          java.lang.String street3, java.lang.String city, java.lang.String zip,
74          long regionId, long countryId, int typeId, boolean mailing,
75          boolean primary)
76          throws com.liferay.portal.kernel.exception.PortalException,
77              com.liferay.portal.kernel.exception.SystemException {
78          return getService()
79                     .updateAddress(addressId, street1, street2, street3, city,
80              zip, regionId, countryId, typeId, mailing, primary);
81      }
82  
83      public static AddressService getService() {
84          if (_service == null) {
85              _service = (AddressService)PortalBeanLocatorUtil.locate(AddressService.class.getName());
86          }
87  
88          return _service;
89      }
90  
91      public void setService(AddressService service) {
92          _service = service;
93      }
94  
95      private static AddressService _service;
96  }