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