Register now for Android Dev Summit 2019!

ThumbRating

public final class ThumbRating
extends Object implements Rating

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


A class for rating with a single degree of rating, "thumb up" vs "thumb down".

Summary

Public constructors

ThumbRating()

Creates a unrated ThumbRating instance.

ThumbRating(boolean thumbIsUp)

Creates a ThumbRating instance.

Public methods

boolean equals(Object obj)
int hashCode()
boolean isRated()

Returns whether there is a rating value available.

boolean isThumbUp()

Returns whether the rating is "thumb up".

String toString()

Inherited methods

Public constructors

ThumbRating

public ThumbRating ()

Creates a unrated ThumbRating instance.

ThumbRating

public ThumbRating (boolean thumbIsUp)

Creates a ThumbRating instance.

Parameters
thumbIsUp boolean: true for a "thumb up" rating, false for "thumb down".

Public methods

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

hashCode

public int hashCode ()

Returns
int

isRated

public boolean isRated ()

Returns whether there is a rating value available.

Returns
boolean true if there is an available rating value.

isThumbUp

public boolean isThumbUp ()

Returns whether the rating is "thumb up".

Returns
boolean true if the rating is "thumb up", false if the rating is "thumb down", or if it is unrated.

toString

public String toString ()

Returns
String