PercentageRating
public final class PercentageRating extends Rating
A rating expressed as a percentage.
Summary
Public fields |
|
|---|---|
final float |
Public constructors |
|---|
|
Creates a unrated instance. |
PercentageRating(@FloatRange(from = 0, to = 100) float percent)Creates a rated instance with the given percentage. |
Public methods |
|
|---|---|
boolean |
|
static PercentageRating |
@UnstableApiRestores a |
float |
Returns the percent value of this rating. |
int |
hashCode() |
boolean |
isRated()Whether the rating exists or not. |
Bundle |
Returns a |
Inherited methods |
||
|---|---|---|
|
Public fields
Public constructors
PercentageRating
public PercentageRating(@FloatRange(from = 0, to = 100) float percent)
Creates a rated instance with the given percentage.
| Parameters | |
|---|---|
@FloatRange(from = 0, to = 100) float percent |
The percentage value of the rating. |
Public methods
fromBundle
@UnstableApi
public static PercentageRating fromBundle(Bundle bundle)
Restores a PercentageRating from a Bundle.
getPercent
public float getPercent()
Returns the percent value of this rating. Will be within the range [0f, 100f], or RATING_UNSET if unrated.
toBundle
@UnstableApi
public Bundle toBundle()
Returns a Bundle representing the information stored in this rating.