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