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