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 * SetRestockableInDaysChangeBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * SetRestockableInDaysChange setRestockableInDaysChange = SetRestockableInDaysChange.builder() 016 * .change("{change}") 017 * .previousValue(1) 018 * .nextValue(1) 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 SetRestockableInDaysChangeBuilder implements Builder<SetRestockableInDaysChange> { 025 026 private String change; 027 028 private Integer previousValue; 029 030 private Integer nextValue; 031 032 /** 033 * set the value to the change 034 * @param change value to be set 035 * @return Builder 036 */ 037 038 public SetRestockableInDaysChangeBuilder change(final String change) { 039 this.change = change; 040 return this; 041 } 042 043 /** 044 * <p>Value before the change.</p> 045 * @param previousValue value to be set 046 * @return Builder 047 */ 048 049 public SetRestockableInDaysChangeBuilder previousValue(final Integer previousValue) { 050 this.previousValue = previousValue; 051 return this; 052 } 053 054 /** 055 * <p>Value after the change.</p> 056 * @param nextValue value to be set 057 * @return Builder 058 */ 059 060 public SetRestockableInDaysChangeBuilder nextValue(final Integer nextValue) { 061 this.nextValue = nextValue; 062 return this; 063 } 064 065 /** 066 * value of change} 067 * @return change 068 */ 069 070 public String getChange() { 071 return this.change; 072 } 073 074 /** 075 * <p>Value before the change.</p> 076 * @return previousValue 077 */ 078 079 public Integer getPreviousValue() { 080 return this.previousValue; 081 } 082 083 /** 084 * <p>Value after the change.</p> 085 * @return nextValue 086 */ 087 088 public Integer getNextValue() { 089 return this.nextValue; 090 } 091 092 /** 093 * builds SetRestockableInDaysChange with checking for non-null required values 094 * @return SetRestockableInDaysChange 095 */ 096 public SetRestockableInDaysChange build() { 097 Objects.requireNonNull(change, SetRestockableInDaysChange.class + ": change is missing"); 098 Objects.requireNonNull(previousValue, SetRestockableInDaysChange.class + ": previousValue is missing"); 099 Objects.requireNonNull(nextValue, SetRestockableInDaysChange.class + ": nextValue is missing"); 100 return new SetRestockableInDaysChangeImpl(change, previousValue, nextValue); 101 } 102 103 /** 104 * builds SetRestockableInDaysChange without checking for non-null required values 105 * @return SetRestockableInDaysChange 106 */ 107 public SetRestockableInDaysChange buildUnchecked() { 108 return new SetRestockableInDaysChangeImpl(change, previousValue, nextValue); 109 } 110 111 /** 112 * factory method for an instance of SetRestockableInDaysChangeBuilder 113 * @return builder 114 */ 115 public static SetRestockableInDaysChangeBuilder of() { 116 return new SetRestockableInDaysChangeBuilder(); 117 } 118 119 /** 120 * create builder for SetRestockableInDaysChange instance 121 * @param template instance with prefilled values for the builder 122 * @return builder 123 */ 124 public static SetRestockableInDaysChangeBuilder of(final SetRestockableInDaysChange template) { 125 SetRestockableInDaysChangeBuilder builder = new SetRestockableInDaysChangeBuilder(); 126 builder.change = template.getChange(); 127 builder.previousValue = template.getPreviousValue(); 128 builder.nextValue = template.getNextValue(); 129 return builder; 130 } 131 132}