001 002package com.commercetools.history.models.common; 003 004import java.time.*; 005import java.util.*; 006 007import com.fasterxml.jackson.annotation.JsonCreator; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import com.fasterxml.jackson.databind.annotation.*; 010 011import io.vrap.rmf.base.client.ModelBase; 012import io.vrap.rmf.base.client.utils.Generated; 013 014import org.apache.commons.lang3.builder.EqualsBuilder; 015import org.apache.commons.lang3.builder.HashCodeBuilder; 016 017/** 018 * ReviewRatingStatistics 019 */ 020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 021public class ReviewRatingStatisticsImpl implements ReviewRatingStatistics, ModelBase { 022 023 private Integer averageRating; 024 025 private Integer highestRating; 026 027 private Integer lowestRating; 028 029 private Integer count; 030 031 private java.lang.Object ratingsDistribution; 032 033 /** 034 * create instance with all properties 035 */ 036 @JsonCreator 037 ReviewRatingStatisticsImpl(@JsonProperty("averageRating") final Integer averageRating, 038 @JsonProperty("highestRating") final Integer highestRating, 039 @JsonProperty("lowestRating") final Integer lowestRating, @JsonProperty("count") final Integer count, 040 @JsonProperty("ratingsDistribution") final java.lang.Object ratingsDistribution) { 041 this.averageRating = averageRating; 042 this.highestRating = highestRating; 043 this.lowestRating = lowestRating; 044 this.count = count; 045 this.ratingsDistribution = ratingsDistribution; 046 } 047 048 /** 049 * create empty instance 050 */ 051 public ReviewRatingStatisticsImpl() { 052 } 053 054 /** 055 * <p>Average rating of one target This number is rounded with 5 decimals.</p> 056 */ 057 058 public Integer getAverageRating() { 059 return this.averageRating; 060 } 061 062 /** 063 * <p>Highest rating of one target</p> 064 */ 065 066 public Integer getHighestRating() { 067 return this.highestRating; 068 } 069 070 /** 071 * <p>Lowest rating of one target</p> 072 */ 073 074 public Integer getLowestRating() { 075 return this.lowestRating; 076 } 077 078 /** 079 * <p>Number of ratings taken into account</p> 080 */ 081 082 public Integer getCount() { 083 return this.count; 084 } 085 086 /** 087 * <p>The full distribution of the ratings. The keys are the different ratings and the values are the count of reviews having this rating. Only the used ratings appear in this object.</p> 088 */ 089 090 public java.lang.Object getRatingsDistribution() { 091 return this.ratingsDistribution; 092 } 093 094 public void setAverageRating(final Integer averageRating) { 095 this.averageRating = averageRating; 096 } 097 098 public void setHighestRating(final Integer highestRating) { 099 this.highestRating = highestRating; 100 } 101 102 public void setLowestRating(final Integer lowestRating) { 103 this.lowestRating = lowestRating; 104 } 105 106 public void setCount(final Integer count) { 107 this.count = count; 108 } 109 110 public void setRatingsDistribution(final java.lang.Object ratingsDistribution) { 111 this.ratingsDistribution = ratingsDistribution; 112 } 113 114 @Override 115 public boolean equals(Object o) { 116 if (this == o) 117 return true; 118 119 if (o == null || getClass() != o.getClass()) 120 return false; 121 122 ReviewRatingStatisticsImpl that = (ReviewRatingStatisticsImpl) o; 123 124 return new EqualsBuilder().append(averageRating, that.averageRating) 125 .append(highestRating, that.highestRating) 126 .append(lowestRating, that.lowestRating) 127 .append(count, that.count) 128 .append(ratingsDistribution, that.ratingsDistribution) 129 .append(averageRating, that.averageRating) 130 .append(highestRating, that.highestRating) 131 .append(lowestRating, that.lowestRating) 132 .append(count, that.count) 133 .append(ratingsDistribution, that.ratingsDistribution) 134 .isEquals(); 135 } 136 137 @Override 138 public int hashCode() { 139 return new HashCodeBuilder(17, 37).append(averageRating) 140 .append(highestRating) 141 .append(lowestRating) 142 .append(count) 143 .append(ratingsDistribution) 144 .toHashCode(); 145 } 146 147}