StarRating

public final class StarRating
extends Object implements Rating

java.lang.Object
   ↳ androidx.media2.session.StarRating


A class for rating expressed as the number of stars.

Summary

Public constructors

StarRating(int maxStars)

Creates a unrated StarRating instance with maxStars.

StarRating(int maxStars, float starRating)

Creates a StarRating instance with maxStars and the given integer or fractional number of stars.

Public methods

boolean equals(Object obj)
int getMaxStars()

Returns the max stars.

float getStarRating()

Returns the star-based rating value.

int hashCode()
boolean isRated()

Returns whether there is a rating value available.

String toString()

Inherited methods

Public constructors

StarRating

public StarRating (int maxStars)

Creates a unrated StarRating instance with maxStars. If maxStars is not a positive integer, it will throw IllegalArg