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