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.Image; 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 Image Label 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 * SetImageLabelChange setImageLabelChange = SetImageLabelChange.builder() 026 * .change("{change}") 027 * .previousValue(previousValueBuilder -> previousValueBuilder) 028 * .nextValue(nextValueBuilder -> nextValueBuilder) 029 * .catalogData("{catalogData}") 030 * .build() 031 * </code></pre> 032 * </div> 033 */ 034@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 035@JsonDeserialize(as = SetImageLabelChangeImpl.class) 036public interface SetImageLabelChange extends Change { 037 038 /** 039 * discriminator value for SetImageLabelChange 040 */ 041 String SET_IMAGE_LABEL_CHANGE = "SetImageLabelChange"; 042 043 /** 044 * 045 * @return type 046 */ 047 @NotNull 048 @JsonProperty("type") 049 public String getType(); 050 051 /** 052 * 053 * @return change 054 */ 055 @NotNull 056 @JsonProperty("change") 057 public String getChange(); 058 059 /** 060 * <p>Value before the change.</p> 061 * @return previousValue 062 */ 063 @NotNull 064 @Valid 065 @JsonProperty("previousValue") 066 public Image getPreviousValue(); 067 068 /** 069 * <p>Value after the change.</p> 070 * @return nextValue 071 */ 072 @NotNull 073 @Valid 074 @JsonProperty("nextValue") 075 public Image getNextValue(); 076 077 /** 078 * <ul> 079 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 080 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 081 * </ul> 082 * @return catalogData 083 */ 084 @NotNull 085 @JsonProperty("catalogData") 086 public String getCatalogData(); 087 088 /** 089 * set change 090 * @param change value to be set 091 */ 092 093 public void setChange(final String change); 094 095 /** 096 * <p>Value before the change.</p> 097 * @param previousValue value to be set 098 */ 099 100 public void setPreviousValue(final Image previousValue); 101 102 /** 103 * <p>Value after the change.</p> 104 * @param nextValue value to be set 105 */ 106 107 public void setNextValue(final Image nextValue); 108 109 /** 110 * <ul> 111 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 112 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 113 * </ul> 114 * @param catalogData value to be set 115 */ 116 117 public void setCatalogData(final String catalogData); 118 119 /** 120 * factory method 121 * @return instance of SetImageLabelChange 122 */ 123 public static SetImageLabelChange of() { 124 return new SetImageLabelChangeImpl(); 125 } 126 127 /** 128 * factory method to create a shallow copy SetImageLabelChange 129 * @param template instance to be copied 130 * @return copy instance 131 */ 132 public static SetImageLabelChange of(final SetImageLabelChange template) { 133 SetImageLabelChangeImpl instance = new SetImageLabelChangeImpl(); 134 instance.setChange(template.getChange()); 135 instance.setPreviousValue(template.getPreviousValue()); 136 instance.setNextValue(template.getNextValue()); 137 instance.setCatalogData(template.getCatalogData()); 138 return instance; 139 } 140 141 /** 142 * factory method to create a deep copy of SetImageLabelChange 143 * @param template instance to be copied 144 * @return copy instance 145 */ 146 @Nullable 147 public static SetImageLabelChange deepCopy(@Nullable final SetImageLabelChange template) { 148 if (template == null) { 149 return null; 150 } 151 SetImageLabelChangeImpl instance = new SetImageLabelChangeImpl(); 152 instance.setChange(template.getChange()); 153 instance.setPreviousValue(com.commercetools.history.models.common.Image.deepCopy(template.getPreviousValue())); 154 instance.setNextValue(com.commercetools.history.models.common.Image.deepCopy(template.getNextValue())); 155 instance.setCatalogData(template.getCatalogData()); 156 return instance; 157 } 158 159 /** 160 * builder factory method for SetImageLabelChange 161 * @return builder 162 */ 163 public static SetImageLabelChangeBuilder builder() { 164 return SetImageLabelChangeBuilder.of(); 165 } 166 167 /** 168 * create builder for SetImageLabelChange instance 169 * @param template instance with prefilled values for the builder 170 * @return builder 171 */ 172 public static SetImageLabelChangeBuilder builder(final SetImageLabelChange template) { 173 return SetImageLabelChangeBuilder.of(template); 174 } 175 176 /** 177 * accessor map function 178 * @param <T> mapped type 179 * @param helper function to map the object 180 * @return mapped value 181 */ 182 default <T> T withSetImageLabelChange(Function<SetImageLabelChange, T> helper) { 183 return helper.apply(this); 184 } 185 186 /** 187 * gives a TypeReference for usage with Jackson DataBind 188 * @return TypeReference 189 */ 190 public static com.fasterxml.jackson.core.type.TypeReference<SetImageLabelChange> typeReference() { 191 return new com.fasterxml.jackson.core.type.TypeReference<SetImageLabelChange>() { 192 @Override 193 public String toString() { 194 return "TypeReference<SetImageLabelChange>"; 195 } 196 }; 197 } 198}