Package com.atlassian.confluence.like
Interface LikeEntityDao
-
- All Known Implementing Classes:
HibernateLikeEntityDao
@ParametersAreNonnullByDefault public interface LikeEntityDao
Persists and retrieves likes. Should only be accessed via aLikeManager
.This interface replaces the deprecated LikeDao
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @NonNull LikeEntity
addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Add a like on the content entity for the given user.int
countLikes(Searchable contentEntity)
@NonNull Map<Searchable,Integer>
countLikes(Collection<? extends Searchable> searchables)
@NonNull List<LikeEntity>
getLikeEntities(Collection<? extends ContentEntityObject> contentEntities)
boolean
hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Returns true if the given user likes this content entity.void
removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
Remove all likes for the given userKeyvoid
removeAllLikesFor(String username)
Deprecated.since 6.13.void
removeAllLikesOn(ContentEntityObject contentEntity)
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 given user.
-
-
-
Method Detail
-
addLike
@NonNull LikeEntity addLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Add a like on the content entity for the given user.- Parameters:
contentEntity
- the content entity to add a like touser
- User liking the content- Returns:
- the created Like
-
removeLike
void removeLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Remove like from content entity for the given user.- Parameters:
contentEntity
- content entity to remove like fromuser
- User removing their Like
-
removeAllLikesOn
void removeAllLikesOn(ContentEntityObject contentEntity)
Removes all likes (for any user) from the specified content entity.- Parameters:
contentEntity
- content entity
-
removeAllLikesFor
@Deprecated void removeAllLikesFor(String username)
Deprecated.since 6.13. useremoveAllLikesFor(UserKey)
insteadRemoves all likes (for any user) from the specified content entity.- Parameters:
username
- the name of the user to remove all likes for
-
removeAllLikesFor
void removeAllLikesFor(@NonNull com.atlassian.sal.api.user.UserKey key)
Remove all likes for the given userKey- Parameters:
key
-
-
hasLike
boolean hasLike(ContentEntityObject contentEntity, com.atlassian.user.User user)
Returns true if the given user likes this content entity.- Parameters:
contentEntity
- the content entityuser
- the User the Like is being checked for- Returns:
- true if the user likes this content entity.
-
getLikeEntities
@NonNull List<LikeEntity> getLikeEntities(Collection<? extends ContentEntityObject> contentEntities)
-
countLikes
int countLikes(Searchable contentEntity)
-
countLikes
@NonNull Map<Searchable,Integer> countLikes(Collection<? extends Searchable> searchables)
-
-