Class RatingSummary
java.lang.Object
com.broadleafcommerce.ratings.domain.RatingSummary
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier 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
-
RatingSummary
public RatingSummary()
-
-
Method Details
-
getAverageRating
Return the overall average rating- Returns:
- The average rating or null if there are no approved ratings.
-
getId
The ID of this rating summary -
getParentRatingSummary
The parent rating summary. For example, if this is a variant, this points to theRatingSummaryof the parent product. Nullable. -
getRatingTargetType
The rating target type, such as PRODUCT or VARIANT. SeeRatingTargetType -
getRatingTargetId
The id of the rating target. For example the product or variant ID. -
getParentTargetId
The parent target ID. For example, if the target type is a Variant, this would be the product's ID. Optional. -
getNumberOfRatings
public int getNumberOfRatings()The total number of ratings for this target. This includes both approved and pending ratings. -
getNumberOfApprovedRatings
public 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:
-
getRatingTotal
public 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:
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState() -
getAttributes
Map to capture any additional data -
setId
The ID of this rating summary -
setParentRatingSummary
The parent rating summary. For example, if this is a variant, this points to theRatingSummaryof the parent product. Nullable. -
setRatingTargetType
The rating target type, such as PRODUCT or VARIANT. SeeRatingTargetType -
setRatingTargetId
The id of the rating target. For example the product or variant ID. -
setParentTargetId
The parent target ID. For example, if the target type is a Variant, this would be the product's ID. Optional. -
setNumberOfRatings
public void setNumberOfRatings(int numberOfRatings) The total number of ratings for this target. This includes both approved and pending ratings. -
setNumberOfApprovedRatings
public 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:
-
setRatingTotal
public 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:
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) -
setAttributes
Map to capture any additional data -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-