PercentageRating

Added in 1.0.0
Deprecated in 1.3.0

class PercentageRating : Rating


A class for rating expressed as a percentage.

Summary

Public constructors

Creates a unrated PercentageRating instance.

Creates a PercentageRating instance with the given percentage.

Public functions

Boolean
equals(obj: Any!)
Float

Returns the percentage-based rating value.

Int
Boolean

Returns whether there is a rating value available.

String!

Public constructors

PercentageRating

Added in 1.0.0
Deprecated in 1.3.0
PercentageRating()

Creates a unrated PercentageRating instance.

PercentageRating

Added in 1.0.0
Deprecated in 1.3.0
PercentageRating(percent: Float)

Creates a PercentageRating instance with the given percentage. If percent is less than 0f or greater than 100f, it will throw IllegalArgumentException.

Parameters
percent: Float

the value of the rating

Public functions

equals

fun equals(obj: Any!): Boolean

getPercentRating

Added in 1.0.0
Deprecated in 1.3.0
fun getPercentRating(): Float

Returns the percentage-based rating value.

Returns
Float

a rating value greater or equal to 0.0f, or a negative value if it is unrated.

hashCode

fun hashCode(): Int

isRated

Added in 1.0.0
Deprecated in 1.3.0
fun isRated(): Boolean

Returns whether there is a rating value available.

Returns
Boolean

true if there is an available rating value.

toString

fun toString(): String!