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