001 002package com.commercetools.api.models.product; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 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 * FacetTerm 018 * 019 * <hr> 020 * Example to create an instance using the builder pattern 021 * <div class=code-example> 022 * <pre><code class='java'> 023 * FacetTerm facetTerm = FacetTerm.builder() 024 * .count(0.3) 025 * .build() 026 * </code></pre> 027 * </div> 028 */ 029@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 030@JsonDeserialize(as = FacetTermImpl.class) 031public interface FacetTerm { 032 033 /** 034 * 035 * @return term 036 */ 037 @NotNull 038 @JsonProperty("term") 039 public Object getTerm(); 040 041 /** 042 * 043 * @return count 044 */ 045 @NotNull 046 @JsonProperty("count") 047 public Long getCount(); 048 049 /** 050 * 051 * @return productCount 052 */ 053 054 @JsonProperty("productCount") 055 public Long getProductCount(); 056 057 /** 058 * set term 059 * @param term value to be set 060 */ 061 062 public void setTerm(final Object term); 063 064 /** 065 * set count 066 * @param count value to be set 067 */ 068 069 public void setCount(final Long count); 070 071 /** 072 * set productCount 073 * @param productCount value to be set 074 */ 075 076 public void setProductCount(final Long productCount); 077 078 /** 079 * factory method 080 * @return instance of FacetTerm 081 */ 082 public static FacetTerm of() { 083 return new FacetTermImpl(); 084 } 085 086 /** 087 * factory method to create a shallow copy FacetTerm 088 * @param template instance to be copied 089 * @return copy instance 090 */ 091 public static FacetTerm of(final FacetTerm template) { 092 FacetTermImpl instance = new FacetTermImpl(); 093 instance.setTerm(template.getTerm()); 094 instance.setCount(template.getCount()); 095 instance.setProductCount(template.getProductCount()); 096 return instance; 097 } 098 099 /** 100 * factory method to create a deep copy of FacetTerm 101 * @param template instance to be copied 102 * @return copy instance 103 */ 104 @Nullable 105 public static FacetTerm deepCopy(@Nullable final FacetTerm template) { 106 if (template == null) { 107 return null; 108 } 109 FacetTermImpl instance = new FacetTermImpl(); 110 instance.setTerm(template.getTerm()); 111 instance.setCount(template.getCount()); 112 instance.setProductCount(template.getProductCount()); 113 return instance; 114 } 115 116 /** 117 * builder factory method for FacetTerm 118 * @return builder 119 */ 120 public static FacetTermBuilder builder() { 121 return FacetTermBuilder.of(); 122 } 123 124 /** 125 * create builder for FacetTerm instance 126 * @param template instance with prefilled values for the builder 127 * @return builder 128 */ 129 public static FacetTermBuilder builder(final FacetTerm template) { 130 return FacetTermBuilder.of(template); 131 } 132 133 /** 134 * accessor map function 135 * @param <T> mapped type 136 * @param helper function to map the object 137 * @return mapped value 138 */ 139 default <T> T withFacetTerm(Function<FacetTerm, T> helper) { 140 return helper.apply(this); 141 } 142 143 /** 144 * gives a TypeReference for usage with Jackson DataBind 145 * @return TypeReference 146 */ 147 public static com.fasterxml.jackson.core.type.TypeReference<FacetTerm> typeReference() { 148 return new com.fasterxml.jackson.core.type.TypeReference<FacetTerm>() { 149 @Override 150 public String toString() { 151 return "TypeReference<FacetTerm>"; 152 } 153 }; 154 } 155}