001    /**
002     * Copyright (c) 2000-2010 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.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link AddressService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       AddressService
030     * @generated
031     */
032    public class AddressServiceUtil {
033            public static com.liferay.portal.model.Address addAddress(
034                    java.lang.String className, long classPK, java.lang.String street1,
035                    java.lang.String street2, java.lang.String street3,
036                    java.lang.String city, java.lang.String zip, long regionId,
037                    long countryId, int typeId, boolean mailing, boolean primary)
038                    throws com.liferay.portal.kernel.exception.PortalException,
039                            com.liferay.portal.kernel.exception.SystemException {
040                    return getService()
041                                       .addAddress(className, classPK, street1, street2, street3,
042                            city, zip, regionId, countryId, typeId, mailing, primary);
043            }
044    
045            public static void deleteAddress(long addressId)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    getService().deleteAddress(addressId);
049            }
050    
051            public static com.liferay.portal.model.Address getAddress(long addressId)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    return getService().getAddress(addressId);
055            }
056    
057            public static java.util.List<com.liferay.portal.model.Address> getAddresses(
058                    java.lang.String className, long classPK)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    return getService().getAddresses(className, classPK);
062            }
063    
064            public static com.liferay.portal.model.Address updateAddress(
065                    long addressId, java.lang.String street1, java.lang.String street2,
066                    java.lang.String street3, java.lang.String city, java.lang.String zip,
067                    long regionId, long countryId, int typeId, boolean mailing,
068                    boolean primary)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    return getService()
072                                       .updateAddress(addressId, street1, street2, street3, city,
073                            zip, regionId, countryId, typeId, mailing, primary);
074            }
075    
076            public static AddressService getService() {
077                    if (_service == null) {
078                            _service = (AddressService)PortalBeanLocatorUtil.locate(AddressService.class.getName());
079                    }
080    
081                    return _service;
082            }
083    
084            public void setService(AddressService service) {
085                    _service = service;
086            }
087    
088            private static AddressService _service;
089    }