public class

Rating

extends Element
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.gd.Rating

Class Overview

Describes a rating.

Summary

Nested Classes
class Rating.Rel Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating. 
Fields
public static final AttributeKey<Float> AVERAGE Average rating.
public static final ElementKey<Void, Rating> KEY The key for this element.
public static final AttributeKey<Integer> MAX Rating scale's maximum value.
public static final AttributeKey<Integer> MIN Rating scale's minimum value.
public static final AttributeKey<Integer> NUM_RATERS Number of ratings taken into account when computing the average value.
public static final AttributeKey<String> REL Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
public static final AttributeKey<Integer> VALUE Rating value.
[Expand]
Inherited Fields
From class com.google.gdata.model.Element
Public Constructors
Rating()
Constructs an instance using the default key.
Protected Constructors
Rating(ElementKey<?, ? extends Rating> key)
Subclass constructor, allows subclasses to supply their own element key.
Rating(ElementKey<?, ? extends Rating> key, Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance.
Public Methods
boolean equals(Object obj)
Float getAverage()
Returns the average rating.
Integer getMax()
Returns the rating scale's maximum value.
Integer getMin()
Returns the rating scale's minimum value.
Integer getNumRaters()
Returns the number of ratings taken into account when computing the average value.
String getRel()
Returns the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
Integer getValue()
Returns the rating value.
boolean hasAverage()
Returns whether it has the average rating.
boolean hasMax()
Returns whether it has the rating scale's maximum value.
boolean hasMin()
Returns whether it has the rating scale's minimum value.
boolean hasNumRaters()
Returns whether it has the number of ratings taken into account when computing the average value.
boolean hasRel()
Returns whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
boolean hasValue()
Returns whether it has the rating value.
int hashCode()
Rating lock()
Locks this element.
static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
Rating setAverage(Float average)
Sets the average rating.
Rating setMax(Integer max)
Sets the rating scale's maximum value.
Rating setMin(Integer min)
Sets the rating scale's minimum value.
Rating setNumRaters(Integer numRaters)
Sets the number of ratings taken into account when computing the average value.
Rating setRel(String rel)
Sets the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.
Rating setValue(Integer value)
Sets the rating value.
[Expand]
Inherited Methods
From class com.google.gdata.model.Element
From class java.lang.Object

Fields

public static final AttributeKey<Float> AVERAGE

Average rating.

public static final ElementKey<Void, Rating> KEY

The key for this element.

public static final AttributeKey<Integer> MAX

Rating scale's maximum value.

public static final AttributeKey<Integer> MIN

Rating scale's minimum value.

public static final AttributeKey<Integer> NUM_RATERS

Number of ratings taken into account when computing the average value.

public static final AttributeKey<String> REL

Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

public static final AttributeKey<Integer> VALUE

Rating value.

Public Constructors

public Rating ()

Constructs an instance using the default key.

Protected Constructors

protected Rating (ElementKey<?, ? extends Rating> key)

Subclass constructor, allows subclasses to supply their own element key.

Parameters
key

protected Rating (ElementKey<?, ? extends Rating> key, Element source)

Constructs a new instance by doing a shallow copy of data from an existing Element instance. Will use the given ElementKey as the key for the element. This constructor is used when adapting from one element key to another. You cannot call this constructor directly, instead use createElement(ElementKey, Element).

Parameters
key The key to use for this element.
source Source element

Public Methods

public boolean equals (Object obj)

Parameters
obj

public Float getAverage ()

Returns the average rating.

Returns
  • average rating

public Integer getMax ()

Returns the rating scale's maximum value.

Returns
  • rating scale's maximum value

public Integer getMin ()

Returns the rating scale's minimum value.

Returns
  • rating scale's minimum value

public Integer getNumRaters ()

Returns the number of ratings taken into account when computing the average value.

Returns
  • number of ratings taken into account when computing the average value

public String getRel ()

Returns the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Returns
  • programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating

public Integer getValue ()

Returns the rating value.

Returns
  • rating value

public boolean hasAverage ()

Returns whether it has the average rating.

Returns
  • whether it has the average rating

public boolean hasMax ()

Returns whether it has the rating scale's maximum value.

Returns
  • whether it has the rating scale's maximum value

public boolean hasMin ()

Returns whether it has the rating scale's minimum value.

Returns
  • whether it has the rating scale's minimum value

public boolean hasNumRaters ()

Returns whether it has the number of ratings taken into account when computing the average value.

Returns
  • whether it has the number of ratings taken into account when computing the average value

public boolean hasRel ()

Returns whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Returns
  • whether it has the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating

public boolean hasValue ()

Returns whether it has the rating value.

Returns
  • whether it has the rating value

public int hashCode ()

public Rating lock ()

Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public Rating setAverage (Float average)

Sets the average rating.

Parameters
average Average rating or null to reset
Returns
  • this to enable chaining setters

public Rating setMax (Integer max)

Sets the rating scale's maximum value.

Parameters
max Rating scale's maximum value or null to reset
Returns
  • this to enable chaining setters

public Rating setMin (Integer min)

Sets the rating scale's minimum value.

Parameters
min Rating scale's minimum value or null to reset
Returns
  • this to enable chaining setters

public Rating setNumRaters (Integer numRaters)

Sets the number of ratings taken into account when computing the average value.

Parameters
numRaters Number of ratings taken into account when computing the average value or null to reset
Returns
  • this to enable chaining setters

public Rating setRel (String rel)

Sets the programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating.

Parameters
rel Programmatic value that describes the aspect that's being rated, if not specified, the rating is an overall rating or null to reset
Returns
  • this to enable chaining setters

public Rating setValue (Integer value)

Sets the rating value.

Parameters
value Rating value or null to reset
Returns
  • this to enable chaining setters