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