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 AnonymousId on Payments.</li> 020 * <li>Set AnonymousId on Shopping Lists.</li> 021 * </ul> 022 * 023 * <hr> 024 * Example to create an instance using the builder pattern 025 * <div class=code-example> 026 * <pre><code class='java'> 027 * SetAnonymousIdChange setAnonymousIdChange = SetAnonymousIdChange.builder() 028 * .change("{change}") 029 * .previousValue("{previousValue}") 030 * .nextValue("{nextValue}") 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 = SetAnonymousIdChangeImpl.class) 037public interface SetAnonymousIdChange extends Change { 038 039 /** 040 * discriminator value for SetAnonymousIdChange 041 */ 042 String SET_ANONYMOUS_ID_CHANGE = "SetAnonymousIdChange"; 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 @JsonProperty("previousValue") 066 public String getPreviousValue(); 067 068 /** 069 * <p>Value after the change.</p> 070 * @return nextValue 071 */ 072 @NotNull 073 @JsonProperty("nextValue") 074 public String getNextValue(); 075 076 /** 077 * set change 078 * @param change value to be set 079 */ 080 081 public void setChange(final String change); 082 083 /** 084 * <p>Value before the change.</p> 085 * @param previousValue value to be set 086 */ 087 088 public void setPreviousValue(final String previousValue); 089 090 /** 091 * <p>Value after the change.</p> 092 * @param nextValue value to be set 093 */ 094 095 public void setNextValue(final String nextValue); 096 097 /** 098 * factory method 099 * @return instance of SetAnonymousIdChange 100 */ 101 public static SetAnonymousIdChange of() { 102 return new SetAnonymousIdChangeImpl(); 103 } 104 105 /** 106 * factory method to create a shallow copy SetAnonymousIdChange 107 * @param template instance to be copied 108 * @return copy instance 109 */ 110 public static SetAnonymousIdChange of(final SetAnonymousIdChange template) { 111 SetAnonymousIdChangeImpl instance = new SetAnonymousIdChangeImpl(); 112 instance.setChange(template.getChange()); 113 instance.setPreviousValue(template.getPreviousValue()); 114 instance.setNextValue(template.getNextValue()); 115 return instance; 116 } 117 118 /** 119 * factory method to create a deep copy of SetAnonymousIdChange 120 * @param template instance to be copied 121 * @return copy instance 122 */ 123 @Nullable 124 public static SetAnonymousIdChange deepCopy(@Nullable final SetAnonymousIdChange template) { 125 if (template == null) { 126 return null; 127 } 128 SetAnonymousIdChangeImpl instance = new SetAnonymousIdChangeImpl(); 129 instance.setChange(template.getChange()); 130 instance.setPreviousValue(template.getPreviousValue()); 131 instance.setNextValue(template.getNextValue()); 132 return instance; 133 } 134 135 /** 136 * builder factory method for SetAnonymousIdChange 137 * @return builder 138 */ 139 public static SetAnonymousIdChangeBuilder builder() { 140 return SetAnonymousIdChangeBuilder.of(); 141 } 142 143 /** 144 * create builder for SetAnonymousIdChange instance 145 * @param template instance with prefilled values for the builder 146 * @return builder 147 */ 148 public static SetAnonymousIdChangeBuilder builder(final SetAnonymousIdChange template) { 149 return SetAnonymousIdChangeBuilder.of(template); 150 } 151 152 /** 153 * accessor map function 154 * @param <T> mapped type 155 * @param helper function to map the object 156 * @return mapped value 157 */ 158 default <T> T withSetAnonymousIdChange(Function<SetAnonymousIdChange, T> helper) { 159 return helper.apply(this); 160 } 161 162 /** 163 * gives a TypeReference for usage with Jackson DataBind 164 * @return TypeReference 165 */ 166 public static com.fasterxml.jackson.core.type.TypeReference<SetAnonymousIdChange> typeReference() { 167 return new com.fasterxml.jackson.core.type.TypeReference<SetAnonymousIdChange>() { 168 @Override 169 public String toString() { 170 return "TypeReference<SetAnonymousIdChange>"; 171 } 172 }; 173 } 174}