public class DefaultFavouritesService extends Object implements FavouritesService
Constructor and Description |
---|
DefaultFavouritesService(FavouritesManager<SharedEntity> favouritesManager) |
Modifier and Type | Method and Description |
---|---|
void |
addFavourite(JiraServiceContext ctx,
SharedEntity entity)
Add the given entity as a favourite of the user passed in the context
|
void |
addFavouriteInPosition(JiraServiceContext ctx,
SharedEntity entity,
long position)
Add the given entity as a favourite of the user passed in the context and place it in the specified position.
|
boolean |
isFavourite(ApplicationUser user,
SharedEntity entity)
Check that the given entity is a favourite of the user passed in the context
|
void |
removeFavourite(JiraServiceContext ctx,
SharedEntity entity)
Remove the given entity as a favourite of the user passed in the context
|
public DefaultFavouritesService(FavouritesManager<SharedEntity> favouritesManager)
public void addFavourite(JiraServiceContext ctx, SharedEntity entity)
FavouritesService
addFavourite
in interface FavouritesService
ctx
- JIRA Service contextentity
- The entity to favouritepublic void addFavouriteInPosition(JiraServiceContext ctx, SharedEntity entity, long position)
FavouritesService
addFavouriteInPosition
in interface FavouritesService
ctx
- JIRA Service Context holding the current userentity
- the entity to favouriteposition
- the position in which this entity should be added in the favourites order.public void removeFavourite(JiraServiceContext ctx, SharedEntity entity)
FavouritesService
removeFavourite
in interface FavouritesService
ctx
- JIRA Service contextentity
- The entity to unfavouritepublic boolean isFavourite(ApplicationUser user, SharedEntity entity)
FavouritesService
isFavourite
in interface FavouritesService
user
- the user to check forentity
- The entity to check favouriteCopyright © 2002-2015 Atlassian. All Rights Reserved.