001 002package com.commercetools.api.models.store; 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 * StoreRemoveSupplyChannelActionBuilder 012 * <hr> 013 * Example to create an instance using the builder pattern 014 * <div class=code-example> 015 * <pre><code class='java'> 016 * StoreRemoveSupplyChannelAction storeRemoveSupplyChannelAction = StoreRemoveSupplyChannelAction.builder() 017 * .supplyChannel(supplyChannelBuilder -> supplyChannelBuilder) 018 * .build() 019 * </code></pre> 020 * </div> 021 */ 022@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 023public class StoreRemoveSupplyChannelActionBuilder implements Builder<StoreRemoveSupplyChannelAction> { 024 025 private com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel; 026 027 /** 028 * <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p> 029 * @param builder function to build the supplyChannel value 030 * @return Builder 031 */ 032 033 public StoreRemoveSupplyChannelActionBuilder supplyChannel( 034 Function<com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder, com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder> builder) { 035 this.supplyChannel = builder.apply(com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder.of()) 036 .build(); 037 return this; 038 } 039 040 /** 041 * <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p> 042 * @param builder function to build the supplyChannel value 043 * @return Builder 044 */ 045 046 public StoreRemoveSupplyChannelActionBuilder withSupplyChannel( 047 Function<com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder, com.commercetools.api.models.channel.ChannelResourceIdentifier> builder) { 048 this.supplyChannel = builder.apply(com.commercetools.api.models.channel.ChannelResourceIdentifierBuilder.of()); 049 return this; 050 } 051 052 /** 053 * <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p> 054 * @param supplyChannel value to be set 055 * @return Builder 056 */ 057 058 public StoreRemoveSupplyChannelActionBuilder supplyChannel( 059 final com.commercetools.api.models.channel.ChannelResourceIdentifier supplyChannel) { 060 this.supplyChannel = supplyChannel; 061 return this; 062 } 063 064 /** 065 * <p>Value to remove. ResourceIdentifier of a Channel with the <code>InventorySupply</code> ChannelRoleEnum.</p> 066 * @return supplyChannel 067 */ 068 069 public com.commercetools.api.models.channel.ChannelResourceIdentifier getSupplyChannel() { 070 return this.supplyChannel; 071 } 072 073 /** 074 * builds StoreRemoveSupplyChannelAction with checking for non-null required values 075 * @return StoreRemoveSupplyChannelAction 076 */ 077 public StoreRemoveSupplyChannelAction build() { 078 Objects.requireNonNull(supplyChannel, StoreRemoveSupplyChannelAction.class + ": supplyChannel is missing"); 079 return new StoreRemoveSupplyChannelActionImpl(supplyChannel); 080 } 081 082 /** 083 * builds StoreRemoveSupplyChannelAction without checking for non-null required values 084 * @return StoreRemoveSupplyChannelAction 085 */ 086 public StoreRemoveSupplyChannelAction buildUnchecked() { 087 return new StoreRemoveSupplyChannelActionImpl(supplyChannel); 088 } 089 090 /** 091 * factory method for an instance of StoreRemoveSupplyChannelActionBuilder 092 * @return builder 093 */ 094 public static StoreRemoveSupplyChannelActionBuilder of() { 095 return new StoreRemoveSupplyChannelActionBuilder(); 096 } 097 098 /** 099 * create builder for StoreRemoveSupplyChannelAction instance 100 * @param template instance with prefilled values for the builder 101 * @return builder 102 */ 103 public static StoreRemoveSupplyChannelActionBuilder of(final StoreRemoveSupplyChannelAction template) { 104 StoreRemoveSupplyChannelActionBuilder builder = new StoreRemoveSupplyChannelActionBuilder(); 105 builder.supplyChannel = template.getSupplyChannel(); 106 return builder; 107 } 108 109}