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