com.atlassian.jira.issue.watchers
Class DefaultIssueWatcherAccessor

java.lang.Object
  extended by com.atlassian.jira.issue.watchers.DefaultIssueWatcherAccessor
All Implemented Interfaces:
IssueWatcherAccessor

public class DefaultIssueWatcherAccessor
extends Object
implements IssueWatcherAccessor


Constructor Summary
DefaultIssueWatcherAccessor(WatcherManager watcherManager)
           
 
Method Summary
 Iterable<User> getDetails(Locale displayLocale, Issue issue)
          Convenience function that simply returns the User objects.
<T> Iterable<T>
getDetails(Locale displayLocale, Issue issue, Function<User,T> transformer)
          Return an Iterable of all watchers for the supplied issue.
 Iterable<String> getWatcherNames(Issue issue)
          Convenience function that simply returns the User names.
 Iterable<com.atlassian.crowd.embedded.api.User> getWatchers(Issue issue, Locale displayLocale)
          Convenience function that simply returns the User objects.
 boolean isWatchingEnabled()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIssueWatcherAccessor

public DefaultIssueWatcherAccessor(WatcherManager watcherManager)
Method Detail

getDetails

public Iterable<User> getDetails(Locale displayLocale,
                                 Issue issue)
Description copied from interface: IssueWatcherAccessor
Convenience function that simply returns the User objects.

Specified by:
getDetails in interface IssueWatcherAccessor
Parameters:
displayLocale - for sorting.
issue - the issue to get the watchers for
Returns:
an Iterable of the users, empty if no watchers

getWatchers

public Iterable<com.atlassian.crowd.embedded.api.User> getWatchers(@NotNull
                                                                   Issue issue,
                                                                   @NotNull
                                                                   Locale displayLocale)
Description copied from interface: IssueWatcherAccessor
Convenience function that simply returns the User objects.

Specified by:
getWatchers in interface IssueWatcherAccessor
Parameters:
issue - the issue to get the watchers for
displayLocale - for sorting.
Returns:
an Iterable of the users, empty if no watchers

getDetails

public <T> Iterable<T> getDetails(Locale displayLocale,
                                  Issue issue,
                                  Function<User,T> transformer)
Description copied from interface: IssueWatcherAccessor
Return an Iterable of all watchers for the supplied issue. The elements are of the type the transformer function returns.

Specified by:
getDetails in interface IssueWatcherAccessor
Type Parameters:
T - the type of element in the returned iterable.
Parameters:
displayLocale - for sorting.
issue - the issue to get the watchers for
transformer - to get the required details from the User objects.
Returns:
an Iterable of the user details, empty if no watchers

isWatchingEnabled

public boolean isWatchingEnabled()
Specified by:
isWatchingEnabled in interface IssueWatcherAccessor

getWatcherNames

public Iterable<String> getWatcherNames(@NotNull
                                        Issue issue)
Description copied from interface: IssueWatcherAccessor
Convenience function that simply returns the User names.

Specified by:
getWatcherNames in interface IssueWatcherAccessor
Parameters:
issue - the issue to get the watchers for
Returns:
an Iterable of the user names, empty if no watchers


Copyright © 2002-2011 Atlassian. All Rights Reserved.