001 002package com.commercetools.history.models.change; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * SetProductVariantKeyChangeBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * SetProductVariantKeyChange setProductVariantKeyChange = SetProductVariantKeyChange.builder() 016 * .change("{change}") 017 * .previousValue("{previousValue}") 018 * .nextValue("{nextValue}") 019 * .catalogData("{catalogData}") 020 * .build() 021 * </code></pre> 022 * </div> 023 */ 024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 025public class SetProductVariantKeyChangeBuilder implements Builder<SetProductVariantKeyChange> { 026 027 private String change; 028 029 private String previousValue; 030 031 private String nextValue; 032 033 private String catalogData; 034 035 /** 036 * set the value to the change 037 * @param change value to be set 038 * @return Builder 039 */ 040 041 public SetProductVariantKeyChangeBuilder change(final String change) { 042 this.change = change; 043 return this; 044 } 045 046 /** 047 * <p>Value before the change.</p> 048 * @param previousValue value to be set 049 * @return Builder 050 */ 051 052 public SetProductVariantKeyChangeBuilder previousValue(final String previousValue) { 053 this.previousValue = previousValue; 054 return this; 055 } 056 057 /** 058 * <p>Value after the change.</p> 059 * @param nextValue value to be set 060 * @return Builder 061 */ 062 063 public SetProductVariantKeyChangeBuilder nextValue(final String nextValue) { 064 this.nextValue = nextValue; 065 return this; 066 } 067 068 /** 069 * <ul> 070 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 071 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 072 * </ul> 073 * @param catalogData value to be set 074 * @return Builder 075 */ 076 077 public SetProductVariantKeyChangeBuilder catalogData(final String catalogData) { 078 this.catalogData = catalogData; 079 return this; 080 } 081 082 /** 083 * value of change} 084 * @return change 085 */ 086 087 public String getChange() { 088 return this.change; 089 } 090 091 /** 092 * <p>Value before the change.</p> 093 * @return previousValue 094 */ 095 096 public String getPreviousValue() { 097 return this.previousValue; 098 } 099 100 /** 101 * <p>Value after the change.</p> 102 * @return nextValue 103 */ 104 105 public String getNextValue() { 106 return this.nextValue; 107 } 108 109 /** 110 * <ul> 111 * <li><code>staged</code>, if the staged ProductCatalogData was updated.</li> 112 * <li><code>current</code>, if the current ProductCatalogData was updated.</li> 113 * </ul> 114 * @return catalogData 115 */ 116 117 public String getCatalogData() { 118 return this.catalogData; 119 } 120 121 /** 122 * builds SetProductVariantKeyChange with checking for non-null required values 123 * @return SetProductVariantKeyChange 124 */ 125 public SetProductVariantKeyChange build() { 126 Objects.requireNonNull(change, SetProductVariantKeyChange.class + ": change is missing"); 127 Objects.requireNonNull(previousValue, SetProductVariantKeyChange.class + ": previousValue is missing"); 128 Objects.requireNonNull(nextValue, SetProductVariantKeyChange.class + ": nextValue is missing"); 129 Objects.requireNonNull(catalogData, SetProductVariantKeyChange.class + ": catalogData is missing"); 130 return new SetProductVariantKeyChangeImpl(change, previousValue, nextValue, catalogData); 131 } 132 133 /** 134 * builds SetProductVariantKeyChange without checking for non-null required values 135 * @return SetProductVariantKeyChange 136 */ 137 public SetProductVariantKeyChange buildUnchecked() { 138 return new SetProductVariantKeyChangeImpl(change, previousValue, nextValue, catalogData); 139 } 140 141 /** 142 * factory method for an instance of SetProductVariantKeyChangeBuilder 143 * @return builder 144 */ 145 public static SetProductVariantKeyChangeBuilder of() { 146 return new SetProductVariantKeyChangeBuilder(); 147 } 148 149 /** 150 * create builder for SetProductVariantKeyChange instance 151 * @param template instance with prefilled values for the builder 152 * @return builder 153 */ 154 public static SetProductVariantKeyChangeBuilder of(final SetProductVariantKeyChange template) { 155 SetProductVariantKeyChangeBuilder builder = new SetProductVariantKeyChangeBuilder(); 156 builder.change = template.getChange(); 157 builder.previousValue = template.getPreviousValue(); 158 builder.nextValue = template.getNextValue(); 159 builder.catalogData = template.getCatalogData(); 160 return builder; 161 } 162 163}