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