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