001 002package com.commercetools.history.models.change_value; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * ShippingMethodChangeValueBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * ShippingMethodChangeValue shippingMethodChangeValue = ShippingMethodChangeValue.builder() 016 * .id("{id}") 017 * .name("{name}") 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 ShippingMethodChangeValueBuilder implements Builder<ShippingMethodChangeValue> { 024 025 private String id; 026 027 private String name; 028 029 /** 030 * <p><code>id</code> of the ShippingMethod.</p> 031 * @param id value to be set 032 * @return Builder 033 */ 034 035 public ShippingMethodChangeValueBuilder id(final String id) { 036 this.id = id; 037 return this; 038 } 039 040 /** 041 * <p>Name of the ShippingMethod.</p> 042 * @param name value to be set 043 * @return Builder 044 */ 045 046 public ShippingMethodChangeValueBuilder name(final String name) { 047 this.name = name; 048 return this; 049 } 050 051 /** 052 * <p><code>id</code> of the ShippingMethod.</p> 053 * @return id 054 */ 055 056 public String getId() { 057 return this.id; 058 } 059 060 /** 061 * <p>Name of the ShippingMethod.</p> 062 * @return name 063 */ 064 065 public String getName() { 066 return this.name; 067 } 068 069 /** 070 * builds ShippingMethodChangeValue with checking for non-null required values 071 * @return ShippingMethodChangeValue 072 */ 073 public ShippingMethodChangeValue build() { 074 Objects.requireNonNull(id, ShippingMethodChangeValue.class + ": id is missing"); 075 Objects.requireNonNull(name, ShippingMethodChangeValue.class + ": name is missing"); 076 return new ShippingMethodChangeValueImpl(id, name); 077 } 078 079 /** 080 * builds ShippingMethodChangeValue without checking for non-null required values 081 * @return ShippingMethodChangeValue 082 */ 083 public ShippingMethodChangeValue buildUnchecked() { 084 return new ShippingMethodChangeValueImpl(id, name); 085 } 086 087 /** 088 * factory method for an instance of ShippingMethodChangeValueBuilder 089 * @return builder 090 */ 091 public static ShippingMethodChangeValueBuilder of() { 092 return new ShippingMethodChangeValueBuilder(); 093 } 094 095 /** 096 * create builder for ShippingMethodChangeValue instance 097 * @param template instance with prefilled values for the builder 098 * @return builder 099 */ 100 public static ShippingMethodChangeValueBuilder of(final ShippingMethodChangeValue template) { 101 ShippingMethodChangeValueBuilder builder = new ShippingMethodChangeValueBuilder(); 102 builder.id = template.getId(); 103 builder.name = template.getName(); 104 return builder; 105 } 106 107}