Class RaterRatingEntity
- java.lang.Object
-
- org.silverpeas.core.webapi.rating.RaterRatingEntity
-
- All Implemented Interfaces:
Serializable,WebEntity
public class RaterRatingEntity extends Object implements WebEntity
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRaterRatingEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RaterRatingEntityfromRateable(Rateable rateableContribution)Creates a new rater rating entity from the specified parameter.protected static RaterRatingEntityfromRaterRating(RaterRating raterRating)Creates a new rater rating entity from the specified parameter.StringgetAsJSonString()StringgetComponentId()Gets the identifier of the Silverpeas component instance to which the rated content belongs.StringgetContributionId()Gets the identifier of the resource that is rated by this.StringgetContributionType()Gets the type of the resource that is rated by this.intgetNumberOfRaterRatings()Gets the number of rater ratings on the contribution.intgetRaterRatingValue()Gets the rating of the current user.floatgetRatingAverage()Gets the average rating on the contribution.URIgetURI()Gets the URI at which this web entity is published and can be accessed.booleanisRatingDone()Indicates if the current user made a rating on the contribution.protected voidsetComponentId(String componentId)protected voidsetContributionId(String contributionId)protected voidsetContributionType(String contributionType)protected voidsetNumberOfRaterRatings(int numberOfRaterRatings)protected voidsetRaterRatingValue(int raterRatingValue)protected voidsetRatingAverage(float ratingAverage)protected voidsetRatingDone(boolean isRatingDone)protected voidsetUri(URI uri)StringtoJSonScript(String jsVariableName)
-
-
-
Method Detail
-
fromRateable
public static RaterRatingEntity fromRateable(Rateable rateableContribution)
Creates a new rater rating entity from the specified parameter. The rater of the returned entity is the user that requests the current treatment.- Parameters:
rateableContribution- a contribution that implements theRateablebehaviour.- Returns:
- the entity representing the rater rating from the specified parameter.
- See Also:
UserDetail.getCurrentRequester()
-
fromRaterRating
protected static RaterRatingEntity fromRaterRating(RaterRating raterRating)
Creates a new rater rating entity from the specified parameter.- Parameters:
raterRating- the rater rating to entitify.- Returns:
- the entity representing the specified rater rating.
-
getURI
public URI getURI()
Description copied from interface:WebEntityGets the URI at which this web entity is published and can be accessed.
-
getComponentId
public String getComponentId()
Gets the identifier of the Silverpeas component instance to which the rated content belongs.- Returns:
- the silverpeas component instance identifier.
-
getContributionType
public String getContributionType()
Gets the type of the resource that is rated by this.- Returns:
- the rated resource type.
-
getContributionId
public String getContributionId()
Gets the identifier of the resource that is rated by this.- Returns:
- the rated resource identifier.
-
getNumberOfRaterRatings
public int getNumberOfRaterRatings()
Gets the number of rater ratings on the contribution.- Returns:
- a positive integer between 0 and 5 (included).
-
getRatingAverage
public float getRatingAverage()
Gets the average rating on the contribution.- Returns:
- a float value between 0 and 5 (included)
-
getRaterRatingValue
public int getRaterRatingValue()
Gets the rating of the current user.- Returns:
- a positive integer between 0 and 5 (included)
-
isRatingDone
public boolean isRatingDone()
Indicates if the current user made a rating on the contribution.- Returns:
- true if the user made a rating, false otherwise.
-
getAsJSonString
public String getAsJSonString()
-
setUri
protected void setUri(URI uri)
-
setComponentId
protected void setComponentId(String componentId)
-
setContributionType
protected void setContributionType(String contributionType)
-
setContributionId
protected void setContributionId(String contributionId)
-
setNumberOfRaterRatings
protected void setNumberOfRaterRatings(int numberOfRaterRatings)
-
setRatingAverage
protected void setRatingAverage(float ratingAverage)
-
setRaterRatingValue
protected void setRaterRatingValue(int raterRatingValue)
-
setRatingDone
protected void setRatingDone(boolean isRatingDone)
-
-