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