001 002package com.commercetools.history.models.change; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * SetCustomFieldChangeBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * SetCustomFieldChange setCustomFieldChange = SetCustomFieldChange.builder() 016 * .change("{change}") 017 * .name("{name}") 018 * .customTypeId("{customTypeId}") 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 SetCustomFieldChangeBuilder implements Builder<SetCustomFieldChange> { 025 026 private String change; 027 028 private java.lang.Object previousValue; 029 030 private java.lang.Object nextValue; 031 032 private String name; 033 034 private String customTypeId; 035 036 /** 037 * set the value to the change 038 * @param change value to be set 039 * @return Builder 040 */ 041 042 public SetCustomFieldChangeBuilder change(final String change) { 043 this.change = change; 044 return this; 045 } 046 047 /** 048 * <p>Value before the change.</p> 049 * @param previousValue value to be set 050 * @return Builder 051 */ 052 053 public SetCustomFieldChangeBuilder previousValue(final java.lang.Object previousValue) { 054 this.previousValue = previousValue; 055 return this; 056 } 057 058 /** 059 * <p>Value after the change.</p> 060 * @param nextValue value to be set 061 * @return Builder 062 */ 063 064 public SetCustomFieldChangeBuilder nextValue(final java.lang.Object nextValue) { 065 this.nextValue = nextValue; 066 return this; 067 } 068 069 /** 070 * <p>Name of the Custom Field.</p> 071 * @param name value to be set 072 * @return Builder 073 */ 074 075 public SetCustomFieldChangeBuilder name(final String name) { 076 this.name = name; 077 return this; 078 } 079 080 /** 081 * <p><code>id</code> of the referenced Type.</p> 082 * @param customTypeId value to be set 083 * @return Builder 084 */ 085 086 public SetCustomFieldChangeBuilder customTypeId(final String customTypeId) { 087 this.customTypeId = customTypeId; 088 return this; 089 } 090 091 /** 092 * value of change} 093 * @return change 094 */ 095 096 public String getChange() { 097 return this.change; 098 } 099 100 /** 101 * <p>Value before the change.</p> 102 * @return previousValue 103 */ 104 105 public java.lang.Object getPreviousValue() { 106 return this.previousValue; 107 } 108 109 /** 110 * <p>Value after the change.</p> 111 * @return nextValue 112 */ 113 114 public java.lang.Object getNextValue() { 115 return this.nextValue; 116 } 117 118 /** 119 * <p>Name of the Custom Field.</p> 120 * @return name 121 */ 122 123 public String getName() { 124 return this.name; 125 } 126 127 /** 128 * <p><code>id</code> of the referenced Type.</p> 129 * @return customTypeId 130 */ 131 132 public String getCustomTypeId() { 133 return this.customTypeId; 134 } 135 136 /** 137 * builds SetCustomFieldChange with checking for non-null required values 138 * @return SetCustomFieldChange 139 */ 140 public SetCustomFieldChange build() { 141 Objects.requireNonNull(change, SetCustomFieldChange.class + ": change is missing"); 142 Objects.requireNonNull(previousValue, SetCustomFieldChange.class + ": previousValue is missing"); 143 Objects.requireNonNull(nextValue, SetCustomFieldChange.class + ": nextValue is missing"); 144 Objects.requireNonNull(name, SetCustomFieldChange.class + ": name is missing"); 145 Objects.requireNonNull(customTypeId, SetCustomFieldChange.class + ": customTypeId is missing"); 146 return new SetCustomFieldChangeImpl(change, previousValue, nextValue, name, customTypeId); 147 } 148 149 /** 150 * builds SetCustomFieldChange without checking for non-null required values 151 * @return SetCustomFieldChange 152 */ 153 public SetCustomFieldChange buildUnchecked() { 154 return new SetCustomFieldChangeImpl(change, previousValue, nextValue, name, customTypeId); 155 } 156 157 /** 158 * factory method for an instance of SetCustomFieldChangeBuilder 159 * @return builder 160 */ 161 public static SetCustomFieldChangeBuilder of() { 162 return new SetCustomFieldChangeBuilder(); 163 } 164 165 /** 166 * create builder for SetCustomFieldChange instance 167 * @param template instance with prefilled values for the builder 168 * @return builder 169 */ 170 public static SetCustomFieldChangeBuilder of(final SetCustomFieldChange template) { 171 SetCustomFieldChangeBuilder builder = new SetCustomFieldChangeBuilder(); 172 builder.change = template.getChange(); 173 builder.previousValue = template.getPreviousValue(); 174 builder.nextValue = template.getNextValue(); 175 builder.name = template.getName(); 176 builder.customTypeId = template.getCustomTypeId(); 177 return builder; 178 } 179 180}