001 002package com.commercetools.api.models.message; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * ProductPriceModeSetMessagePayloadBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * ProductPriceModeSetMessagePayload productPriceModeSetMessagePayload = ProductPriceModeSetMessagePayload.builder() 016 * .to(ProductPriceModeEnum.EMBEDDED) 017 * .build() 018 * </code></pre> 019 * </div> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class ProductPriceModeSetMessagePayloadBuilder implements Builder<ProductPriceModeSetMessagePayload> { 023 024 private com.commercetools.api.models.product.ProductPriceModeEnum to; 025 026 /** 027 * <p>The PriceMode that was set.</p> 028 * @param to value to be set 029 * @return Builder 030 */ 031 032 public ProductPriceModeSetMessagePayloadBuilder to( 033 final com.commercetools.api.models.product.ProductPriceModeEnum to) { 034 this.to = to; 035 return this; 036 } 037 038 /** 039 * <p>The PriceMode that was set.</p> 040 * @return to 041 */ 042 043 public com.commercetools.api.models.product.ProductPriceModeEnum getTo() { 044 return this.to; 045 } 046 047 /** 048 * builds ProductPriceModeSetMessagePayload with checking for non-null required values 049 * @return ProductPriceModeSetMessagePayload 050 */ 051 public ProductPriceModeSetMessagePayload build() { 052 Objects.requireNonNull(to, ProductPriceModeSetMessagePayload.class + ": to is missing"); 053 return new ProductPriceModeSetMessagePayloadImpl(to); 054 } 055 056 /** 057 * builds ProductPriceModeSetMessagePayload without checking for non-null required values 058 * @return ProductPriceModeSetMessagePayload 059 */ 060 public ProductPriceModeSetMessagePayload buildUnchecked() { 061 return new ProductPriceModeSetMessagePayloadImpl(to); 062 } 063 064 /** 065 * factory method for an instance of ProductPriceModeSetMessagePayloadBuilder 066 * @return builder 067 */ 068 public static ProductPriceModeSetMessagePayloadBuilder of() { 069 return new ProductPriceModeSetMessagePayloadBuilder(); 070 } 071 072 /** 073 * create builder for ProductPriceModeSetMessagePayload instance 074 * @param template instance with prefilled values for the builder 075 * @return builder 076 */ 077 public static ProductPriceModeSetMessagePayloadBuilder of(final ProductPriceModeSetMessagePayload template) { 078 ProductPriceModeSetMessagePayloadBuilder builder = new ProductPriceModeSetMessagePayloadBuilder(); 079 builder.to = template.getTo(); 080 return builder; 081 } 082 083}