Class RatingSummary
java.lang.Object
com.broadleafcommerce.ratings.domain.RatingSummary
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Map to capture any additional dataReturn the overall average ratingcom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
getId()
The ID of this rating summaryint
The total number of approved ratings for this target.int
The 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.long
The total numerical value of all approved ratings for this summary.int
hashCode()
void
setAttributes
(Map<String, String> attributes) Map to capture any additional datavoid
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) void
The ID of this rating summaryvoid
setNumberOfApprovedRatings
(int numberOfApprovedRatings) The total number of approved ratings for this target.void
setNumberOfRatings
(int numberOfRatings) The total number of ratings for this target.void
setParentRatingSummary
(RatingSummary parentRatingSummary) The parent rating summary.void
setParentTargetId
(String parentTargetId) The parent target ID.void
setRatingTargetId
(String ratingTargetId) The id of the rating target.void
setRatingTargetType
(String ratingTargetType) The rating target type, such as PRODUCT or VARIANT.void
setRatingTotal
(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 theRatingSummary
of 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 approvedratings
and 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 theRatingSummary
of 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 approvedratings
and 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
-