Class ContributionRating

    • Constructor Detail

      • ContributionRating

        public ContributionRating​(ContributionRatingPK pk)
        Default constructor.
        Parameters:
        pk - the technical primary key of a rating related to a contribution.
    • Method Detail

      • getInstanceId

        public String getInstanceId()
        Gets the identifier of the component instance which the contribution aimed by the rating is associated.
        Returns:
        the identifier of a component instance.
      • getContributionId

        public String getContributionId()
        Gets the identifier of the contribution aimed by the rating.
        Returns:
        the identifier of a contribution.
      • getContributionType

        public String getContributionType()
        Gets the type of the contribution aimed by the rating.
        Returns:
        the type of a contribution.
      • getRatingAverage

        public float getRatingAverage()
        Gets the average of all rater ratings associated to the contribution aimed by the rating.
        Returns:
        the average of all rater ratings.
      • addRaterRating

        public void addRaterRating​(String raterId,
                                   Integer ratingValue)
        Adds a rating of a rater.
        Parameters:
        raterId - the identifier of the user that is the rater.
        ratingValue - the value of the rater rating.
      • getRaterRating

        public RaterRating getRaterRating​(UserDetail rater)
        Gets an instance of a RaterRating according to the specified rater.
        Parameters:
        rater - the user for whom the rating is requested.
        Returns:
        the rater rating instance of the specified rater. Null if no rating has been done by the specified user.
      • getRaterRatings

        public Map<String,​Integer> getRaterRatings()
        Gets all rater ratings associated to the rating.
        Returns:
        a mapping between user id of raters and their rating.