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 Change the order of AttributeDefinitions 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 * ChangeAttributeOrderByNameChange changeAttributeOrderByNameChange = ChangeAttributeOrderByNameChange.builder() 024 * .change("{change}") 025 * .plusPreviousValue(previousValueBuilder -> previousValueBuilder) 026 * .plusNextValue(nextValueBuilder -> nextValueBuilder) 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 = ChangeAttributeOrderByNameChangeImpl.class) 033public interface ChangeAttributeOrderByNameChange extends Change { 034 035 /** 036 * discriminator value for ChangeAttributeOrderByNameChange 037 */ 038 String CHANGE_ATTRIBUTE_ORDER_BY_NAME_CHANGE = "ChangeAttributeOrderByNameChange"; 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 List<String> getPreviousValue(); 063 064 /** 065 * <p>Value after the change.</p> 066 * @return nextValue 067 */ 068 @NotNull 069 @JsonProperty("nextValue") 070 public List<String> 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 values to be set 082 */ 083 084 @JsonIgnore 085 public void setPreviousValue(final String... previousValue); 086 087 /** 088 * <p>Value before the change.</p> 089 * @param previousValue values to be set 090 */ 091 092 public void setPreviousValue(final List<String> previousValue); 093 094 /** 095 * <p>Value after the change.</p> 096 * @param nextValue values to be set 097 */ 098 099 @JsonIgnore 100 public void setNextValue(final String... nextValue); 101 102 /** 103 * <p>Value after the change.</p> 104 * @param nextValue values to be set 105 */ 106 107 public void setNextValue(final List<String> nextValue); 108 109 /** 110 * factory method 111 * @return instance of ChangeAttributeOrderByNameChange 112 */ 113 public static ChangeAttributeOrderByNameChange of() { 114 return new ChangeAttributeOrderByNameChangeImpl(); 115 } 116 117 /** 118 * factory method to create a shallow copy ChangeAttributeOrderByNameChange 119 * @param template instance to be copied 120 * @return copy instance 121 */ 122 public static ChangeAttributeOrderByNameChange of(final ChangeAttributeOrderByNameChange template) { 123 ChangeAttributeOrderByNameChangeImpl instance = new ChangeAttributeOrderByNameChangeImpl(); 124 instance.setChange(template.getChange()); 125 instance.setPreviousValue(template.getPreviousValue()); 126 instance.setNextValue(template.getNextValue()); 127 return instance; 128 } 129 130 /** 131 * factory method to create a deep copy of ChangeAttributeOrderByNameChange 132 * @param template instance to be copied 133 * @return copy instance 134 */ 135 @Nullable 136 public static ChangeAttributeOrderByNameChange deepCopy(@Nullable final ChangeAttributeOrderByNameChange template) { 137 if (template == null) { 138 return null; 139 } 140 ChangeAttributeOrderByNameChangeImpl instance = new ChangeAttributeOrderByNameChangeImpl(); 141 instance.setChange(template.getChange()); 142 instance.setPreviousValue(Optional.ofNullable(template.getPreviousValue()).map(ArrayList::new).orElse(null)); 143 instance.setNextValue(Optional.ofNullable(template.getNextValue()).map(ArrayList::new).orElse(null)); 144 return instance; 145 } 146 147 /** 148 * builder factory method for ChangeAttributeOrderByNameChange 149 * @return builder 150 */ 151 public static ChangeAttributeOrderByNameChangeBuilder builder() { 152 return ChangeAttributeOrderByNameChangeBuilder.of(); 153 } 154 155 /** 156 * create builder for ChangeAttributeOrderByNameChange instance 157 * @param template instance with prefilled values for the builder 158 * @return builder 159 */ 160 public static ChangeAttributeOrderByNameChangeBuilder builder(final ChangeAttributeOrderByNameChange template) { 161 return ChangeAttributeOrderByNameChangeBuilder.of(template); 162 } 163 164 /** 165 * accessor map function 166 * @param <T> mapped type 167 * @param helper function to map the object 168 * @return mapped value 169 */ 170 default <T> T withChangeAttributeOrderByNameChange(Function<ChangeAttributeOrderByNameChange, T> helper) { 171 return helper.apply(this); 172 } 173 174 /** 175 * gives a TypeReference for usage with Jackson DataBind 176 * @return TypeReference 177 */ 178 public static com.fasterxml.jackson.core.type.TypeReference<ChangeAttributeOrderByNameChange> typeReference() { 179 return new com.fasterxml.jackson.core.type.TypeReference<ChangeAttributeOrderByNameChange>() { 180 @Override 181 public String toString() { 182 return "TypeReference<ChangeAttributeOrderByNameChange>"; 183 } 184 }; 185 } 186}