001 002package com.commercetools.api.models.inventory; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * InventoryEntryChangeQuantityActionBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * InventoryEntryChangeQuantityAction inventoryEntryChangeQuantityAction = InventoryEntryChangeQuantityAction.builder() 016 * .quantity(0.3) 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 InventoryEntryChangeQuantityActionBuilder implements Builder<InventoryEntryChangeQuantityAction> { 023 024 private Long quantity; 025 026 /** 027 * <p>Value to set for <code>quantityOnStock</code>.</p> 028 * @param quantity value to be set 029 * @return Builder 030 */ 031 032 public InventoryEntryChangeQuantityActionBuilder quantity(final Long quantity) { 033 this.quantity = quantity; 034 return this; 035 } 036 037 /** 038 * <p>Value to set for <code>quantityOnStock</code>.</p> 039 * @return quantity 040 */ 041 042 public Long getQuantity() { 043 return this.quantity; 044 } 045 046 /** 047 * builds InventoryEntryChangeQuantityAction with checking for non-null required values 048 * @return InventoryEntryChangeQuantityAction 049 */ 050 public InventoryEntryChangeQuantityAction build() { 051 Objects.requireNonNull(quantity, InventoryEntryChangeQuantityAction.class + ": quantity is missing"); 052 return new InventoryEntryChangeQuantityActionImpl(quantity); 053 } 054 055 /** 056 * builds InventoryEntryChangeQuantityAction without checking for non-null required values 057 * @return InventoryEntryChangeQuantityAction 058 */ 059 public InventoryEntryChangeQuantityAction buildUnchecked() { 060 return new InventoryEntryChangeQuantityActionImpl(quantity); 061 } 062 063 /** 064 * factory method for an instance of InventoryEntryChangeQuantityActionBuilder 065 * @return builder 066 */ 067 public static InventoryEntryChangeQuantityActionBuilder of() { 068 return new InventoryEntryChangeQuantityActionBuilder(); 069 } 070 071 /** 072 * create builder for InventoryEntryChangeQuantityAction instance 073 * @param template instance with prefilled values for the builder 074 * @return builder 075 */ 076 public static InventoryEntryChangeQuantityActionBuilder of(final InventoryEntryChangeQuantityAction template) { 077 InventoryEntryChangeQuantityActionBuilder builder = new InventoryEntryChangeQuantityActionBuilder(); 078 builder.quantity = template.getQuantity(); 079 return builder; 080 } 081 082}