001 002package com.commercetools.api.models.order; 003 004import java.util.*; 005 006import javax.annotation.Nullable; 007 008import io.vrap.rmf.base.client.Builder; 009import io.vrap.rmf.base.client.utils.Generated; 010 011/** 012 * OrderSetBillingAddressCustomFieldActionBuilder 013 * <hr> 014 * Example to create an instance using the builder pattern 015 * <div class=code-example> 016 * <pre><code class='java'> 017 * OrderSetBillingAddressCustomFieldAction orderSetBillingAddressCustomFieldAction = OrderSetBillingAddressCustomFieldAction.builder() 018 * .name("{name}") 019 * .build() 020 * </code></pre> 021 * </div> 022 */ 023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 024public class OrderSetBillingAddressCustomFieldActionBuilder 025 implements Builder<OrderSetBillingAddressCustomFieldAction> { 026 027 private String name; 028 029 @Nullable 030 private java.lang.Object value; 031 032 /** 033 * <p>Name of the Custom Field.</p> 034 * @param name value to be set 035 * @return Builder 036 */ 037 038 public OrderSetBillingAddressCustomFieldActionBuilder name(final String name) { 039 this.name = name; 040 return this; 041 } 042 043 /** 044 * <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p> 045 * @param value value to be set 046 * @return Builder 047 */ 048 049 public OrderSetBillingAddressCustomFieldActionBuilder value(@Nullable final java.lang.Object value) { 050 this.value = value; 051 return this; 052 } 053 054 /** 055 * <p>Name of the Custom Field.</p> 056 * @return name 057 */ 058 059 public String getName() { 060 return this.name; 061 } 062 063 /** 064 * <p>If <code>value</code> is absent or <code>null</code>, this field will be removed if it exists. Removing a field that does not exist returns an InvalidOperation error. If <code>value</code> is provided, it is set for the field defined by <code>name</code>.</p> 065 * @return value 066 */ 067 068 @Nullable 069 public java.lang.Object getValue() { 070 return this.value; 071 } 072 073 /** 074 * builds OrderSetBillingAddressCustomFieldAction with checking for non-null required values 075 * @return OrderSetBillingAddressCustomFieldAction 076 */ 077 public OrderSetBillingAddressCustomFieldAction build() { 078 Objects.requireNonNull(name, OrderSetBillingAddressCustomFieldAction.class + ": name is missing"); 079 return new OrderSetBillingAddressCustomFieldActionImpl(name, value); 080 } 081 082 /** 083 * builds OrderSetBillingAddressCustomFieldAction without checking for non-null required values 084 * @return OrderSetBillingAddressCustomFieldAction 085 */ 086 public OrderSetBillingAddressCustomFieldAction buildUnchecked() { 087 return new OrderSetBillingAddressCustomFieldActionImpl(name, value); 088 } 089 090 /** 091 * factory method for an instance of OrderSetBillingAddressCustomFieldActionBuilder 092 * @return builder 093 */ 094 public static OrderSetBillingAddressCustomFieldActionBuilder of() { 095 return new OrderSetBillingAddressCustomFieldActionBuilder(); 096 } 097 098 /** 099 * create builder for OrderSetBillingAddressCustomFieldAction instance 100 * @param template instance with prefilled values for the builder 101 * @return builder 102 */ 103 public static OrderSetBillingAddressCustomFieldActionBuilder of( 104 final OrderSetBillingAddressCustomFieldAction template) { 105 OrderSetBillingAddressCustomFieldActionBuilder builder = new OrderSetBillingAddressCustomFieldActionBuilder(); 106 builder.name = template.getName(); 107 builder.value = template.getValue(); 108 return builder; 109 } 110 111}