Class PercentageRating

  • All Implemented Interfaces:
    Bundleable

    public final class PercentageRating
    extends Rating
    A rating expressed as a percentage.
    • Constructor Detail

      • PercentageRating

        public PercentageRating()
        Creates a unrated instance.
      • PercentageRating

        public PercentageRating​(@FloatRange(from=0.0,to=100.0)
                                float percent)
        Creates a rated instance with the given percentage.
        Parameters:
        percent - The percentage value of the rating.
    • Method Detail

      • isRated

        public boolean isRated()
        Description copied from class: Rating
        Whether the rating exists or not.
        Specified by:
        isRated in class Rating
      • getPercent

        public float getPercent()
        Returns the percent value of this rating. Will be within the range [0f, 100f], or Rating.RATING_UNSET if unrated.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable
                              Object obj)
        Overrides:
        equals in class Object
      • toBundle

        public Bundle toBundle()
        Description copied from interface: Bundleable
        Returns a Bundle representing the information stored in this object.