|
| 1 | + |
| 2 | +package com.commercetools.api.models.product_search; |
| 3 | + |
| 4 | +import java.time.*; |
| 5 | +import java.util.*; |
| 6 | +import java.util.function.Function; |
| 7 | + |
| 8 | +import javax.annotation.Nullable; |
| 9 | + |
| 10 | +import com.fasterxml.jackson.annotation.*; |
| 11 | +import com.fasterxml.jackson.databind.annotation.*; |
| 12 | + |
| 13 | +import io.vrap.rmf.base.client.utils.Generated; |
| 14 | + |
| 15 | +import jakarta.validation.constraints.NotNull; |
| 16 | + |
| 17 | +/** |
| 18 | + * <p>Result of a stats facet. The data type of <code>min</code> <code>max</code>, <code>mean</code>, and <code>sum</code> matches the data type of the <code>field</code> in the facet expression.</p> |
| 19 | + * |
| 20 | + * <hr> |
| 21 | + * Example to create an instance using the builder pattern |
| 22 | + * <div class=code-example> |
| 23 | + * <pre><code class='java'> |
| 24 | + * ProductSearchFacetResultStats productSearchFacetResultStats = ProductSearchFacetResultStats.builder() |
| 25 | + * .name("{name}") |
| 26 | + * .count(0.3) |
| 27 | + * .build() |
| 28 | + * </code></pre> |
| 29 | + * </div> |
| 30 | + */ |
| 31 | +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") |
| 32 | +@JsonDeserialize(as = ProductSearchFacetResultStatsImpl.class) |
| 33 | +public interface ProductSearchFacetResultStats extends ProductSearchFacetResult { |
| 34 | + |
| 35 | + /** |
| 36 | + * <p>The minimum value of the field, scoped to the faceted results.</p> |
| 37 | + * @return min |
| 38 | + */ |
| 39 | + @NotNull |
| 40 | + @JsonProperty("min") |
| 41 | + public Object getMin(); |
| 42 | + |
| 43 | + /** |
| 44 | + * <p>The maximum value of the field, scoped to the faceted results.</p> |
| 45 | + * @return max |
| 46 | + */ |
| 47 | + @NotNull |
| 48 | + @JsonProperty("max") |
| 49 | + public Object getMax(); |
| 50 | + |
| 51 | + /** |
| 52 | + * <p>The average value of the field calculated as <code>sum</code> / <code>count</code>.</p> |
| 53 | + * <p>Only returned for number fields.</p> |
| 54 | + * @return mean |
| 55 | + */ |
| 56 | + |
| 57 | + @JsonProperty("mean") |
| 58 | + public Object getMean(); |
| 59 | + |
| 60 | + /** |
| 61 | + * <p>The sum of values of the field that match the facet expression.</p> |
| 62 | + * <p>Only returned for number fields.</p> |
| 63 | + * @return sum |
| 64 | + */ |
| 65 | + |
| 66 | + @JsonProperty("sum") |
| 67 | + public Object getSum(); |
| 68 | + |
| 69 | + /** |
| 70 | + * <p>The total number of values counted that match the facet expression.</p> |
| 71 | + * @return count |
| 72 | + */ |
| 73 | + @NotNull |
| 74 | + @JsonProperty("count") |
| 75 | + public Long getCount(); |
| 76 | + |
| 77 | + /** |
| 78 | + * <p>The minimum value of the field, scoped to the faceted results.</p> |
| 79 | + * @param min value to be set |
| 80 | + */ |
| 81 | + |
| 82 | + public void setMin(final Object min); |
| 83 | + |
| 84 | + /** |
| 85 | + * <p>The maximum value of the field, scoped to the faceted results.</p> |
| 86 | + * @param max value to be set |
| 87 | + */ |
| 88 | + |
| 89 | + public void setMax(final Object max); |
| 90 | + |
| 91 | + /** |
| 92 | + * <p>The average value of the field calculated as <code>sum</code> / <code>count</code>.</p> |
| 93 | + * <p>Only returned for number fields.</p> |
| 94 | + * @param mean value to be set |
| 95 | + */ |
| 96 | + |
| 97 | + public void setMean(final Object mean); |
| 98 | + |
| 99 | + /** |
| 100 | + * <p>The sum of values of the field that match the facet expression.</p> |
| 101 | + * <p>Only returned for number fields.</p> |
| 102 | + * @param sum value to be set |
| 103 | + */ |
| 104 | + |
| 105 | + public void setSum(final Object sum); |
| 106 | + |
| 107 | + /** |
| 108 | + * <p>The total number of values counted that match the facet expression.</p> |
| 109 | + * @param count value to be set |
| 110 | + */ |
| 111 | + |
| 112 | + public void setCount(final Long count); |
| 113 | + |
| 114 | + /** |
| 115 | + * factory method |
| 116 | + * @return instance of ProductSearchFacetResultStats |
| 117 | + */ |
| 118 | + public static ProductSearchFacetResultStats of() { |
| 119 | + return new ProductSearchFacetResultStatsImpl(); |
| 120 | + } |
| 121 | + |
| 122 | + /** |
| 123 | + * factory method to create a shallow copy ProductSearchFacetResultStats |
| 124 | + * @param template instance to be copied |
| 125 | + * @return copy instance |
| 126 | + */ |
| 127 | + public static ProductSearchFacetResultStats of(final ProductSearchFacetResultStats template) { |
| 128 | + ProductSearchFacetResultStatsImpl instance = new ProductSearchFacetResultStatsImpl(); |
| 129 | + instance.setName(template.getName()); |
| 130 | + instance.setMin(template.getMin()); |
| 131 | + instance.setMax(template.getMax()); |
| 132 | + instance.setMean(template.getMean()); |
| 133 | + instance.setSum(template.getSum()); |
| 134 | + instance.setCount(template.getCount()); |
| 135 | + return instance; |
| 136 | + } |
| 137 | + |
| 138 | + public ProductSearchFacetResultStats copyDeep(); |
| 139 | + |
| 140 | + /** |
| 141 | + * factory method to create a deep copy of ProductSearchFacetResultStats |
| 142 | + * @param template instance to be copied |
| 143 | + * @return copy instance |
| 144 | + */ |
| 145 | + @Nullable |
| 146 | + public static ProductSearchFacetResultStats deepCopy(@Nullable final ProductSearchFacetResultStats template) { |
| 147 | + if (template == null) { |
| 148 | + return null; |
| 149 | + } |
| 150 | + ProductSearchFacetResultStatsImpl instance = new ProductSearchFacetResultStatsImpl(); |
| 151 | + instance.setName(template.getName()); |
| 152 | + instance.setMin(template.getMin()); |
| 153 | + instance.setMax(template.getMax()); |
| 154 | + instance.setMean(template.getMean()); |
| 155 | + instance.setSum(template.getSum()); |
| 156 | + instance.setCount(template.getCount()); |
| 157 | + return instance; |
| 158 | + } |
| 159 | + |
| 160 | + /** |
| 161 | + * builder factory method for ProductSearchFacetResultStats |
| 162 | + * @return builder |
| 163 | + */ |
| 164 | + public static ProductSearchFacetResultStatsBuilder builder() { |
| 165 | + return ProductSearchFacetResultStatsBuilder.of(); |
| 166 | + } |
| 167 | + |
| 168 | + /** |
| 169 | + * create builder for ProductSearchFacetResultStats instance |
| 170 | + * @param template instance with prefilled values for the builder |
| 171 | + * @return builder |
| 172 | + */ |
| 173 | + public static ProductSearchFacetResultStatsBuilder builder(final ProductSearchFacetResultStats template) { |
| 174 | + return ProductSearchFacetResultStatsBuilder.of(template); |
| 175 | + } |
| 176 | + |
| 177 | + /** |
| 178 | + * accessor map function |
| 179 | + * @param <T> mapped type |
| 180 | + * @param helper function to map the object |
| 181 | + * @return mapped value |
| 182 | + */ |
| 183 | + default <T> T withProductSearchFacetResultStats(Function<ProductSearchFacetResultStats, T> helper) { |
| 184 | + return helper.apply(this); |
| 185 | + } |
| 186 | + |
| 187 | + /** |
| 188 | + * gives a TypeReference for usage with Jackson DataBind |
| 189 | + * @return TypeReference |
| 190 | + */ |
| 191 | + public static com.fasterxml.jackson.core.type.TypeReference<ProductSearchFacetResultStats> typeReference() { |
| 192 | + return new com.fasterxml.jackson.core.type.TypeReference<ProductSearchFacetResultStats>() { |
| 193 | + @Override |
| 194 | + public String toString() { |
| 195 | + return "TypeReference<ProductSearchFacetResultStats>"; |
| 196 | + } |
| 197 | + }; |
| 198 | + } |
| 199 | +} |
0 commit comments