001 002package com.commercetools.history.models.change; 003 004import java.time.*; 005import java.util.*; 006import java.util.function.Function; 007 008import javax.annotation.Nullable; 009import javax.validation.Valid; 010import javax.validation.constraints.NotNull; 011 012import com.commercetools.history.models.common.CategoryOrderHints; 013import com.fasterxml.jackson.annotation.*; 014import com.fasterxml.jackson.databind.annotation.*; 015 016import io.vrap.rmf.base.client.utils.Generated; 017 018/** 019 * <p>Change triggered by the Set Category Order Hint update action.</p> 020 * 021 * <hr> 022 * Example to create an instance using the builder pattern 023 * <div class=code-example> 024 * <pre><code class='java'> 025 * SetCategoryOrderHintChange setCategoryOrderHintChange = SetCategoryOrderHintChange.builder() 026 * .change("{change}") 027 * .previousValue(previousValueBuilder -> previousValueBuilder) 028 * .nextValue(nextValueBuilder -> nextValueBuilder) 029 * .catalogData("{catalogData}") 030 * .categoryId("{categoryId}") 031 * .build() 032 * </code></pre> 033 * </div> 034 */ 035@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 036@JsonDeserialize(as = SetCategoryOrderHintChangeImpl.class) 037public interface SetCategoryOrderHintChange extends Change { 038 039 /** 040 * discriminator value for SetCategoryOrderHintChange 041 */ 042 String SET_CATEGORY_ORDER_HINT_CHANGE = "SetCategoryOrderHintChange"; 043 044 /** 045 * 046 * @return type 047 */ 048 @NotNull 049 @JsonProperty("type") 050 public String getType(); 051 052 /** 053 * 054 * @return change 055 */ 056 @NotNull 057 @JsonProperty("change") 058 public String getChange(); 059 060 /** 061 * <p>Value before the change.</p> 062 * @return previousValue 063 */ 064 @NotNull 065 @Valid 066 @JsonProperty("previousValue") 067 public CategoryOrderHints getPreviousValue(); 068 069 /** 070 * <p>Value after the change.</p> 071 * @return nextValue 072 */ 073 @NotNull 074 @Valid 075 @JsonProperty("nextValue") 076 public CategoryOrderHints getNextValue(); 077 078 /** 079 * <ul> 080 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 081 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 082 * </ul> 083 * @return catalogData 084 */ 085 @NotNull 086 @JsonProperty("catalogData") 087 public String getCatalogData(); 088 089 /** 090 * <p><code>id</code> of the updated Category.</p> 091 * @return categoryId 092 */ 093 @NotNull 094 @JsonProperty("categoryId") 095 public String getCategoryId(); 096 097 /** 098 * set change 099 * @param change value to be set 100 */ 101 102 public void setChange(final String change); 103 104 /** 105 * <p>Value before the change.</p> 106 * @param previousValue value to be set 107 */ 108 109 public void setPreviousValue(final CategoryOrderHints previousValue); 110 111 /** 112 * <p>Value after the change.</p> 113 * @param nextValue value to be set 114 */ 115 116 public void setNextValue(final CategoryOrderHints nextValue); 117 118 /** 119 * <ul> 120 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 121 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 122 * </ul> 123 * @param catalogData value to be set 124 */ 125 126 public void setCatalogData(final String catalogData); 127 128 /** 129 * <p><code>id</code> of the updated Category.</p> 130 * @param categoryId value to be set 131 */ 132 133 public void setCategoryId(final String categoryId); 134 135 /** 136 * factory method 137 * @return instance of SetCategoryOrderHintChange 138 */ 139 public static SetCategoryOrderHintChange of() { 140 return new SetCategoryOrderHintChangeImpl(); 141 } 142 143 /** 144 * factory method to create a shallow copy SetCategoryOrderHintChange 145 * @param template instance to be copied 146 * @return copy instance 147 */ 148 public static SetCategoryOrderHintChange of(final SetCategoryOrderHintChange template) { 149 SetCategoryOrderHintChangeImpl instance = new SetCategoryOrderHintChangeImpl(); 150 instance.setChange(template.getChange()); 151 instance.setPreviousValue(template.getPreviousValue()); 152 instance.setNextValue(template.getNextValue()); 153 instance.setCatalogData(template.getCatalogData()); 154 instance.setCategoryId(template.getCategoryId()); 155 return instance; 156 } 157 158 /** 159 * factory method to create a deep copy of SetCategoryOrderHintChange 160 * @param template instance to be copied 161 * @return copy instance 162 */ 163 @Nullable 164 public static SetCategoryOrderHintChange deepCopy(@Nullable final SetCategoryOrderHintChange template) { 165 if (template == null) { 166 return null; 167 } 168 SetCategoryOrderHintChangeImpl instance = new SetCategoryOrderHintChangeImpl(); 169 instance.setChange(template.getChange()); 170 instance.setPreviousValue( 171 com.commercetools.history.models.common.CategoryOrderHints.deepCopy(template.getPreviousValue())); 172 instance.setNextValue( 173 com.commercetools.history.models.common.CategoryOrderHints.deepCopy(template.getNextValue())); 174 instance.setCatalogData(template.getCatalogData()); 175 instance.setCategoryId(template.getCategoryId()); 176 return instance; 177 } 178 179 /** 180 * builder factory method for SetCategoryOrderHintChange 181 * @return builder 182 */ 183 public static SetCategoryOrderHintChangeBuilder builder() { 184 return SetCategoryOrderHintChangeBuilder.of(); 185 } 186 187 /** 188 * create builder for SetCategoryOrderHintChange instance 189 * @param template instance with prefilled values for the builder 190 * @return builder 191 */ 192 public static SetCategoryOrderHintChangeBuilder builder(final SetCategoryOrderHintChange template) { 193 return SetCategoryOrderHintChangeBuilder.of(template); 194 } 195 196 /** 197 * accessor map function 198 * @param <T> mapped type 199 * @param helper function to map the object 200 * @return mapped value 201 */ 202 default <T> T withSetCategoryOrderHintChange(Function<SetCategoryOrderHintChange, T> helper) { 203 return helper.apply(this); 204 } 205 206 /** 207 * gives a TypeReference for usage with Jackson DataBind 208 * @return TypeReference 209 */ 210 public static com.fasterxml.jackson.core.type.TypeReference<SetCategoryOrderHintChange> typeReference() { 211 return new com.fasterxml.jackson.core.type.TypeReference<SetCategoryOrderHintChange>() { 212 @Override 213 public String toString() { 214 return "TypeReference<SetCategoryOrderHintChange>"; 215 } 216 }; 217 } 218}