com.atlassian.jira.notification
Class NotificationRecipient

java.lang.Object
  extended by com.atlassian.jira.notification.NotificationRecipient

@PublicApi
public class NotificationRecipient
extends Object

A simple data holder class that represents a user and or email address who will be send a noitification from JIRA, usually via email.


Field Summary
static String MIMETYPE_HTML
           
static String MIMETYPE_HTML_DISPLAY
           
static String MIMETYPE_TEXT
           
static String MIMETYPE_TEXT_DISPLAY
           
 
Constructor Summary
NotificationRecipient(ApplicationUser user)
          The format is set to html or text as specified in jira-application.properties file.
NotificationRecipient(String pEmail)
           
NotificationRecipient(com.atlassian.crowd.embedded.api.User user)
          Deprecated. Use NotificationRecipient(ApplicationUser) instead. Since v6.0.
 
Method Summary
 boolean equals(Object o)
           
 String getEmail()
           
 String getFormat()
           
 ApplicationUser getUser()
          Returns a user if this NotificationRecipient was constructed with a user.
 com.atlassian.crowd.embedded.api.User getUserRecipient()
          Deprecated. Use getUser() instead. Since v6.0.
 int hashCode()
           
 boolean isHtml()
           
 boolean isInGroup(String groupName)
          Checks if the recipient is in the specified group.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIMETYPE_HTML

public static final String MIMETYPE_HTML
See Also:
Constant Field Values

MIMETYPE_HTML_DISPLAY

public static final String MIMETYPE_HTML_DISPLAY
See Also:
Constant Field Values

MIMETYPE_TEXT

public static final String MIMETYPE_TEXT
See Also:
Constant Field Values

MIMETYPE_TEXT_DISPLAY

public static final String MIMETYPE_TEXT_DISPLAY
See Also:
Constant Field Values
Constructor Detail

NotificationRecipient

public NotificationRecipient(@Nonnull
                             com.atlassian.crowd.embedded.api.User user)
Deprecated. Use NotificationRecipient(ApplicationUser) instead. Since v6.0.

The format is set to html or text as specified in jira-application.properties file. If this setting is not configured correctly, default to text format.

Parameters:
user - recipient user

NotificationRecipient

public NotificationRecipient(@Nonnull
                             ApplicationUser user)
The format is set to html or text as specified in jira-application.properties file. If this setting is not configured correctly, default to text format.

Parameters:
user - recipient user

NotificationRecipient

public NotificationRecipient(String pEmail)
Method Detail

getEmail

public String getEmail()

getUserRecipient

public com.atlassian.crowd.embedded.api.User getUserRecipient()
Deprecated. Use getUser() instead. Since v6.0.

Returns a user if this NotificationRecipient was constructed with a user. Returns null if this NotificationRecipient was constructed with an e-mail address only

Returns:
user recipient of this notification, or null, if recipient is an email address.

getUser

public ApplicationUser getUser()
Returns a user if this NotificationRecipient was constructed with a user. Returns null if this NotificationRecipient was constructed with an e-mail address only

Returns:
user recipient of this notification, or null, if recipient is an email address.

isHtml

public boolean isHtml()

getFormat

public String getFormat()

isInGroup

public boolean isInGroup(String groupName)
Checks if the recipient is in the specified group. If this is only an email address they are not in any group.

Parameters:
groupName - group name
Returns:
true if the user is set and is in the group, false otherwise

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2014 Atlassian. All Rights Reserved.