public class RatingAPI extends BaseAPI
RatingType,
RatingValue| Constructor and Description |
|---|
RatingAPI(ResourceFactory resourceFactory) |
| Modifier and Type | Method and Description |
|---|---|
int |
approves(Reference reference)
Indicates that the active user approves the object
|
int |
attend(Reference reference)
Indicates that the active user will attend
|
int |
createRating(Reference reference,
RatingType type,
int value)
Add a new rating of the user to the object.
|
void |
deleteRating(Reference reference,
RatingType type)
Deletes the rating of the given type on the object by the active user
|
int |
disapproves(Reference reference)
Indicates that the active user disapproves the object
|
int |
fivestar(Reference reference,
int stars)
Give a five star rating of the object
|
RatingValuesMap |
getAllRatings(Reference reference)
Returns all the ratings for the given object.
|
int |
getRating(Reference reference,
RatingType type,
int userId)
Returns the rating value for the given rating type, object and user.
|
TypeRating |
getRatings(Reference reference,
RatingType type)
Get the rating average (for fivestar) and totals for the given rating
type on the specified object.
|
int |
like(Reference reference)
Indicates that the active user likes the object
|
int |
maybeAttend(Reference reference)
Indicates that the active user will maybe attend
|
int |
no(Reference reference)
Indicates that the active user says "no" to the object
|
int |
notAttend(Reference reference)
Indicates that the active user will not attend
|
int |
thumbsDown(Reference reference)
Indicates that the active user give thumbs down to the object
|
int |
thumbsUp(Reference reference)
Indicates that the active user give thumbs up to the object
|
int |
yes(Reference reference)
Indicates that the active user says "yes" to the object
|
getResourceFactorypublic RatingAPI(ResourceFactory resourceFactory)
public int createRating(Reference reference, RatingType type, int value)
reference - The reference to the object the rating should be created ontype - The type of the ratingvalue - The value for the ratingRatingValuepublic void deleteRating(Reference reference, RatingType type)
reference - The reference ot the objecttype - The type of the ratingpublic int like(Reference reference)
reference - The reference to the object that should be likedpublic int yes(Reference reference)
reference - The reference to the objectpublic int no(Reference reference)
reference - The reference to the objectpublic int approves(Reference reference)
reference - The reference to the objectpublic int disapproves(Reference reference)
reference - The reference to the objectpublic int fivestar(Reference reference, int stars)
reference - The reference to the objectstars - The number of stars to give, between 1 and 5public int attend(Reference reference)
reference - The reference to the objectpublic int maybeAttend(Reference reference)
reference - The reference to the objectpublic int notAttend(Reference reference)
reference - The reference to the objectpublic int thumbsUp(Reference reference)
reference - The reference to the objectpublic int thumbsDown(Reference reference)
reference - The reference to the objectpublic RatingValuesMap getAllRatings(Reference reference)
reference - The reference to the object to get ratings forpublic TypeRating getRatings(Reference reference, RatingType type)
reference - The reference to the object to get ratings fortype - The type of rating to returnpublic int getRating(Reference reference, RatingType type, int userId)
reference - The reference to the object to get ratings fortype - The type of rating to returnuserId - The id of the user for which to return the rating forCopyright © 2014. All Rights Reserved.