Class RatingSummary
java.lang.Object
com.broadleafcommerce.ratings.domain.RatingSummary
- All Implemented Interfaces:
- Serializable
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanbooleanMap to capture any additional dataReturn the overall average ratingcom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStategetId()The ID of this rating summaryintThe total number of approved ratings for this target.intThe total number of ratings for this target.The parent rating summary.The parent target ID.The id of the rating target.The rating target type, such as PRODUCT or VARIANT.longThe total numerical value of all approved ratings for this summary.inthashCode()voidsetAttributes(Map<String, String> attributes) Map to capture any additional datavoidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) voidThe ID of this rating summaryvoidsetNumberOfApprovedRatings(int numberOfApprovedRatings) The total number of approved ratings for this target.voidsetNumberOfRatings(int numberOfRatings) The total number of ratings for this target.voidsetParentRatingSummary(RatingSummary parentRatingSummary) The parent rating summary.voidsetParentTargetId(String parentTargetId) The parent target ID.voidsetRatingTargetId(String ratingTargetId) The id of the rating target.voidsetRatingTargetType(String ratingTargetType) The rating target type, such as PRODUCT or VARIANT.voidsetRatingTotal(long ratingTotal) The total numerical value of all approved ratings for this summary.toString()
- 
Constructor Details- 
RatingSummarypublic RatingSummary()
 
- 
- 
Method Details- 
getAverageRatingReturn the overall average rating- Returns:
- The average rating or null if there are no approved ratings.
 
- 
getIdThe ID of this rating summary
- 
getParentRatingSummaryThe parent rating summary. For example, if this is a variant, this points to theRatingSummaryof the parent product. Nullable.
- 
getRatingTargetTypeThe rating target type, such as PRODUCT or VARIANT. SeeRatingTargetType
- 
getRatingTargetIdThe id of the rating target. For example the product or variant ID.
- 
getParentTargetIdThe parent target ID. For example, if the target type is a Variant, this would be the product's ID. Optional.
- 
getNumberOfRatingspublic int getNumberOfRatings()The total number of ratings for this target. This includes both approved and pending ratings.
- 
getNumberOfApprovedRatingspublic int getNumberOfApprovedRatings()The total number of approved ratings for this target. Used to calculate the average rating. Includes ratings with APPROVED or NOT_NEEDED status.- See Also:
 
- 
getRatingTotalpublic long getRatingTotal()The total numerical value of all approved ratings for this summary. This is the sum of all approvedratingsand is used to calculate the average rating. Includes ratings with APPROVED or NOT_NEEDED status.- See Also:
 
- 
getContextStatepublic com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
- 
getAttributesMap to capture any additional data
- 
setIdThe ID of this rating summary
- 
setParentRatingSummaryThe parent rating summary. For example, if this is a variant, this points to theRatingSummaryof the parent product. Nullable.
- 
setRatingTargetTypeThe rating target type, such as PRODUCT or VARIANT. SeeRatingTargetType
- 
setRatingTargetIdThe id of the rating target. For example the product or variant ID.
- 
setParentTargetIdThe parent target ID. For example, if the target type is a Variant, this would be the product's ID. Optional.
- 
setNumberOfRatingspublic void setNumberOfRatings(int numberOfRatings) The total number of ratings for this target. This includes both approved and pending ratings.
- 
setNumberOfApprovedRatingspublic void setNumberOfApprovedRatings(int numberOfApprovedRatings) The total number of approved ratings for this target. Used to calculate the average rating. Includes ratings with APPROVED or NOT_NEEDED status.- See Also:
 
- 
setRatingTotalpublic void setRatingTotal(long ratingTotal) The total numerical value of all approved ratings for this summary. This is the sum of all approvedratingsand is used to calculate the average rating. Includes ratings with APPROVED or NOT_NEEDED status.- See Also:
 
- 
setContextStatepublic void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) 
- 
setAttributesMap to capture any additional data
- 
equals
- 
canEqual
- 
hashCodepublic int hashCode()
- 
toString
 
-