001 002package com.commercetools.ml.models.similar_products; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.validation.Valid; 009import javax.validation.constraints.NotNull; 010 011import com.fasterxml.jackson.annotation.*; 012import com.fasterxml.jackson.databind.annotation.*; 013 014import io.vrap.rmf.base.client.utils.Generated; 015 016/** 017 * SimilarProductsPagedQueryResult 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * SimilarProductsPagedQueryResult similarProductsPagedQueryResult = SimilarProductsPagedQueryResult.builder() 024 * .count(0.3) 025 * .total(0.3) 026 * .offset(0.3) 027 * .plusResults(resultsBuilder -> resultsBuilder) 028 * .meta(metaBuilder -> metaBuilder) 029 * .build() 030 * </code></pre> 031 * </div> 032 */ 033@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 034@JsonDeserialize(as = SimilarProductsPagedQueryResultImpl.class) 035public interface SimilarProductsPagedQueryResult { 036 037 /** 038 * 039 */ 040 @NotNull 041 @JsonProperty("count") 042 public Long getCount(); 043 044 /** 045 * 046 */ 047 @NotNull 048 @JsonProperty("total") 049 public Long getTotal(); 050 051 /** 052 * <p>Number of elements skipped.</p> 053 */ 054 @NotNull 055 @JsonProperty("offset") 056 public Long getOffset(); 057 058 /** 059 * 060 */ 061 @NotNull 062 @Valid 063 @JsonProperty("results") 064 public List<SimilarProductPair> getResults(); 065 066 /** 067 * 068 */ 069 @NotNull 070 @Valid 071 @JsonProperty("meta") 072 public SimilarProductSearchRequestMeta getMeta(); 073 074 public void setCount(final Long count); 075 076 public void setTotal(final Long total); 077 078 public void setOffset(final Long offset); 079 080 @JsonIgnore 081 public void setResults(final SimilarProductPair... results); 082 083 public void setResults(final List<SimilarProductPair> results); 084 085 public void setMeta(final SimilarProductSearchRequestMeta meta); 086 087 public static SimilarProductsPagedQueryResult of() { 088 return new SimilarProductsPagedQueryResultImpl(); 089 } 090 091 public static SimilarProductsPagedQueryResult of(final SimilarProductsPagedQueryResult template) { 092 SimilarProductsPagedQueryResultImpl instance = new SimilarProductsPagedQueryResultImpl(); 093 instance.setCount(template.getCount()); 094 instance.setTotal(template.getTotal()); 095 instance.setOffset(template.getOffset()); 096 instance.setResults(template.getResults()); 097 instance.setMeta(template.getMeta()); 098 return instance; 099 } 100 101 public static SimilarProductsPagedQueryResultBuilder builder() { 102 return SimilarProductsPagedQueryResultBuilder.of(); 103 } 104 105 public static SimilarProductsPagedQueryResultBuilder builder(final SimilarProductsPagedQueryResult template) { 106 return SimilarProductsPagedQueryResultBuilder.of(template); 107 } 108 109 default <T> T withSimilarProductsPagedQueryResult(Function<SimilarProductsPagedQueryResult, T> helper) { 110 return helper.apply(this); 111 } 112 113 public static com.fasterxml.jackson.core.type.TypeReference<SimilarProductsPagedQueryResult> typeReference() { 114 return new com.fasterxml.jackson.core.type.TypeReference<SimilarProductsPagedQueryResult>() { 115 @Override 116 public String toString() { 117 return "TypeReference<SimilarProductsPagedQueryResult>"; 118 } 119 }; 120 } 121}