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.SyncInfo; 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>Update SyncInfo on Orders.</li> 022 * <li>Update SyncInfo on Staged Orders.</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 * UpdateSyncInfoChange updateSyncInfoChange = UpdateSyncInfoChange.builder() 030 * .change("{change}") 031 * .nextValue(nextValueBuilder -> nextValueBuilder) 032 * .channelId("{channelId}") 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 = UpdateSyncInfoChangeImpl.class) 039public interface UpdateSyncInfoChange extends Change { 040 041 /** 042 * discriminator value for UpdateSyncInfoChange 043 */ 044 String UPDATE_SYNC_INFO_CHANGE = "UpdateSyncInfoChange"; 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 after the change.</p> 064 * @return nextValue 065 */ 066 @NotNull 067 @Valid 068 @JsonProperty("nextValue") 069 public SyncInfo getNextValue(); 070 071 /** 072 * <p><code>id</code> of the updated Channel.</p> 073 * @return channelId 074 */ 075 @NotNull 076 @JsonProperty("channelId") 077 public String getChannelId(); 078 079 /** 080 * set change 081 * @param change value to be set 082 */ 083 084 public void setChange(final String change); 085 086 /** 087 * <p>Value after the change.</p> 088 * @param nextValue value to be set 089 */ 090 091 public void setNextValue(final SyncInfo nextValue); 092 093 /** 094 * <p><code>id</code> of the updated Channel.</p> 095 * @param channelId value to be set 096 */ 097 098 public void setChannelId(final String channelId); 099 100 /** 101 * factory method 102 * @return instance of UpdateSyncInfoChange 103 */ 104 public static UpdateSyncInfoChange of() { 105 return new UpdateSyncInfoChangeImpl(); 106 } 107 108 /** 109 * factory method to create a shallow copy UpdateSyncInfoChange 110 * @param template instance to be copied 111 * @return copy instance 112 */ 113 public static UpdateSyncInfoChange of(final UpdateSyncInfoChange template) { 114 UpdateSyncInfoChangeImpl instance = new UpdateSyncInfoChangeImpl(); 115 instance.setChange(template.getChange()); 116 instance.setNextValue(template.getNextValue()); 117 instance.setChannelId(template.getChannelId()); 118 return instance; 119 } 120 121 /** 122 * factory method to create a deep copy of UpdateSyncInfoChange 123 * @param template instance to be copied 124 * @return copy instance 125 */ 126 @Nullable 127 public static UpdateSyncInfoChange deepCopy(@Nullable final UpdateSyncInfoChange template) { 128 if (template == null) { 129 return null; 130 } 131 UpdateSyncInfoChangeImpl instance = new UpdateSyncInfoChangeImpl(); 132 instance.setChange(template.getChange()); 133 instance.setNextValue(com.commercetools.history.models.common.SyncInfo.deepCopy(template.getNextValue())); 134 instance.setChannelId(template.getChannelId()); 135 return instance; 136 } 137 138 /** 139 * builder factory method for UpdateSyncInfoChange 140 * @return builder 141 */ 142 public static UpdateSyncInfoChangeBuilder builder() { 143 return UpdateSyncInfoChangeBuilder.of(); 144 } 145 146 /** 147 * create builder for UpdateSyncInfoChange instance 148 * @param template instance with prefilled values for the builder 149 * @return builder 150 */ 151 public static UpdateSyncInfoChangeBuilder builder(final UpdateSyncInfoChange template) { 152 return UpdateSyncInfoChangeBuilder.of(template); 153 } 154 155 /** 156 * accessor map function 157 * @param <T> mapped type 158 * @param helper function to map the object 159 * @return mapped value 160 */ 161 default <T> T withUpdateSyncInfoChange(Function<UpdateSyncInfoChange, T> helper) { 162 return helper.apply(this); 163 } 164 165 /** 166 * gives a TypeReference for usage with Jackson DataBind 167 * @return TypeReference 168 */ 169 public static com.fasterxml.jackson.core.type.TypeReference<UpdateSyncInfoChange> typeReference() { 170 return new com.fasterxml.jackson.core.type.TypeReference<UpdateSyncInfoChange>() { 171 @Override 172 public String toString() { 173 return "TypeReference<UpdateSyncInfoChange>"; 174 } 175 }; 176 } 177}