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