public class AggregateRating extends GenericParcelable implements Validator, JSONifiable
Aggregate Ratings & Reviews information about a developer app. Clients can get the average rating of an app by dividing the total number of stars an app has received by the total number of times it has been reviewed.
Modifier and Type | Class and Description |
---|---|
static interface |
AggregateRating.Constraints |
JSONifiable.Creator<T>
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>
Modifier and Type | Field and Description |
---|---|
static Parcelable.Creator<AggregateRating> |
CREATOR |
static JSONifiable.Creator<AggregateRating> |
JSON_CREATOR |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
Modifier | Constructor and Description |
---|---|
|
AggregateRating()
Constructs a new empty instance.
|
|
AggregateRating(AggregateRating src)
Constructs a new instance that is a deep copy of the source instance.
|
protected |
AggregateRating(boolean noInit)
Constructs a new empty instance.
|
|
AggregateRating(JSONObject jsonObject)
Construct a new instance backed by the given JSONObject, the parameter is not copied so changes to it will be
reflected in this instance and vice-versa.
|
|
AggregateRating(String json)
Constructs a new instance from the given JSON String.
|
Modifier and Type | Method and Description |
---|---|
void |
clearReviewCount()
Clears the 'reviewCount' field, the 'has' method for this field will now return false
|
void |
clearTotalStars()
Clears the 'totalStars' field, the 'has' method for this field will now return false
|
void |
clearWeightedRating()
Clears the 'weightedRating' field, the 'has' method for this field will now return false
|
boolean |
containsChanges()
Returns true if this instance has any changes.
|
AggregateRating |
copyChanges()
Create a copy of this instance that contains only fields that were set after the constructor was called.
|
protected GenericClient |
getGenericClient() |
JSONObject |
getJSONObject()
Returns the internal JSONObject backing this instance, the return value is not a copy so changes to it will be
reflected in this instance and vice-versa.
|
Long |
getReviewCount()
Total number of reviews that merchants have written about this app
|
Long |
getTotalStars()
Sum of the number of stars this app has received for all of its reviews
|
Double |
getWeightedRating()
Weighted Rating for this App
|
boolean |
hasReviewCount()
Checks whether the 'reviewCount' field has been set, however the value could be null
|
boolean |
hasTotalStars()
Checks whether the 'totalStars' field has been set, however the value could be null
|
boolean |
hasWeightedRating()
Checks whether the 'weightedRating' field has been set, however the value could be null
|
boolean |
isNotNullReviewCount()
Checks whether the 'reviewCount' field is set and is not null
|
boolean |
isNotNullTotalStars()
Checks whether the 'totalStars' field is set and is not null
|
boolean |
isNotNullWeightedRating()
Checks whether the 'weightedRating' field is set and is not null
|
void |
mergeChanges(AggregateRating src)
Copy all the changed fields from the given source to this instance.
|
void |
resetChangeLog()
Reset the log of changes made to this instance, calling copyChanges() after this would return an empty instance.
|
AggregateRating |
setReviewCount(Long reviewCount)
Sets the field 'reviewCount'.
|
AggregateRating |
setTotalStars(Long totalStars)
Sets the field 'totalStars'.
|
AggregateRating |
setWeightedRating(Double weightedRating)
Sets the field 'weightedRating'.
|
void |
validate() |
describeContents, getBundle, toString, writeToParcel
public static final Parcelable.Creator<AggregateRating> CREATOR
public static final JSONifiable.Creator<AggregateRating> JSON_CREATOR
public AggregateRating()
protected AggregateRating(boolean noInit)
public AggregateRating(String json) throws IllegalArgumentException
IllegalArgumentException
public AggregateRating(JSONObject jsonObject)
public AggregateRating(AggregateRating src)
public Long getReviewCount()
public Long getTotalStars()
public Double getWeightedRating()
protected GenericClient getGenericClient()
getGenericClient
in class GenericParcelable
public JSONObject getJSONObject()
getJSONObject
in interface JSONifiable
public boolean isNotNullReviewCount()
public boolean isNotNullTotalStars()
public boolean isNotNullWeightedRating()
public boolean hasReviewCount()
public boolean hasTotalStars()
public boolean hasWeightedRating()
public AggregateRating setReviewCount(Long reviewCount)
public AggregateRating setTotalStars(Long totalStars)
public AggregateRating setWeightedRating(Double weightedRating)
public void clearReviewCount()
public void clearTotalStars()
public void clearWeightedRating()
public boolean containsChanges()
public void resetChangeLog()
public AggregateRating copyChanges()
public void mergeChanges(AggregateRating src)