001    /**
002     * Copyright (c) 2000-2013 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.kernel.notifications;
016    
017    import java.util.HashMap;
018    import java.util.Map;
019    
020    /**
021     * @author Jonathan Lee
022     */
023    public class UserNotificationDefinition {
024    
025            public UserNotificationDefinition(
026                    String portletId, long classNameId, int notificationType,
027                    String description) {
028    
029                    _classNameId = classNameId;
030                    _description = description;
031                    _notificationType = notificationType;
032                    _portletId = portletId;
033            }
034    
035            public void addUserNotificationDeliveryType(
036                    UserNotificationDeliveryType userNotificationDeliveryType) {
037    
038                    _userNotificationDeliveryTypes.put(
039                            userNotificationDeliveryType.getType(),
040                            userNotificationDeliveryType);
041            }
042    
043            public long getClassNameId() {
044                    return _classNameId;
045            }
046    
047            public String getDescription() {
048                    return _description;
049            }
050    
051            public int getNotificationType() {
052                    return _notificationType;
053            }
054    
055            public String getPortletId() {
056                    return _portletId;
057            }
058    
059            public UserNotificationDeliveryType getUserNotificationDeliveryType(
060                    int deliveryType) {
061    
062                    return _userNotificationDeliveryTypes.get(deliveryType);
063            }
064    
065            public Map<Integer, UserNotificationDeliveryType>
066                    getUserNotificationDeliveryTypes() {
067    
068                    return _userNotificationDeliveryTypes;
069            }
070    
071            private long _classNameId;
072            private String _description;
073            private int _notificationType;
074            private String _portletId;
075            private Map<Integer, UserNotificationDeliveryType>
076                    _userNotificationDeliveryTypes =
077                            new HashMap<Integer, UserNotificationDeliveryType>();
078    
079    }