public interface LikeManager
Modifier and Type | Method and Description |
---|---|
Like |
addLike(ContentEntityObject contentEntity,
com.atlassian.user.User user)
Add a like for the provided user.
|
Map<com.atlassian.bonnie.Searchable,Integer> |
countLikes(Collection<? extends com.atlassian.bonnie.Searchable> searchables)
Count the number of likes for the given objects
|
int |
countLikes(com.atlassian.bonnie.Searchable searchable)
Count the number of likes for the given object
|
Map<Long,List<Like>> |
getLikes(Collection<? extends ContentEntityObject> contentEntities)
Gets all the likes for the specified content entities (likes are ordered such that recent likes come first).
|
List<Like> |
getLikes(ContentEntityObject contentEntity)
Gets all the likes for the specified content entity (likes are ordered such that recent likes come first)
|
boolean |
hasLike(ContentEntityObject contentEntity,
com.atlassian.user.User user)
Returns true if the provided user likes this content entity.
|
void |
removeAllLikesFor(String username)
Deprecated.
since 6.13. User
removeAllLikesFor(UserKey) instead. |
void |
removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
Remove all likes for the given userkey.
|
void |
removeAllLikesOn(ContentEntityObject content)
Removes all likes (for any user) from the specified content entity.
|
void |
removeLike(ContentEntityObject contentEntity,
com.atlassian.user.User user)
Remove like from content entity for the current logged in user.
|
Like addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
user
- the usercontentEntity
- the content entity to add a like tovoid removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
user
- the usercontentEntity
- content entity to remove like fromvoid removeAllLikesOn(ContentEntityObject content)
content
- content entity@Deprecated void removeAllLikesFor(String username)
removeAllLikesFor(UserKey)
instead.username
- the name of the user to remove all likes forvoid removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
key
- a userKey. If no such user exists, this method will be a noop.boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
contentEntity
- the content entityuser
- the user who would like this contentList<Like> getLikes(ContentEntityObject contentEntity)
contentEntity
- the content entityMap<Long,List<Like>> getLikes(Collection<? extends ContentEntityObject> contentEntities)
contentEntities
- content entitiesMap<com.atlassian.bonnie.Searchable,Integer> countLikes(Collection<? extends com.atlassian.bonnie.Searchable> searchables)
searchables
- A searchable object whose ID must be setint countLikes(com.atlassian.bonnie.Searchable searchable)
searchable
- A searchable object whose ID must be setCopyright © 2003–2020 Atlassian. All rights reserved.