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 * ChangeIsSearchableChangeBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * ChangeIsSearchableChange changeIsSearchableChange = ChangeIsSearchableChange.builder() 016 * .change("{change}") 017 * .previousValue(true) 018 * .nextValue(true) 019 * .attributeName("{attributeName}") 020 * .build() 021 * </code></pre> 022 * </div> 023 */ 024@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 025public class ChangeIsSearchableChangeBuilder implements Builder<ChangeIsSearchableChange> { 026 027 private String change; 028 029 private Boolean previousValue; 030 031 private Boolean nextValue; 032 033 private String attributeName; 034 035 /** 036 * set the value to the change 037 * @param change value to be set 038 * @return Builder 039 */ 040 041 public ChangeIsSearchableChangeBuilder change(final String change) { 042 this.change = change; 043 return this; 044 } 045 046 /** 047 * <p>Value before the change.</p> 048 * @param previousValue value to be set 049 * @return Builder 050 */ 051 052 public ChangeIsSearchableChangeBuilder previousValue(final Boolean previousValue) { 053 this.previousValue = previousValue; 054 return this; 055 } 056 057 /** 058 * <p>Value after the change.</p> 059 * @param nextValue value to be set 060 * @return Builder 061 */ 062 063 public ChangeIsSearchableChangeBuilder nextValue(final Boolean nextValue) { 064 this.nextValue = nextValue; 065 return this; 066 } 067 068 /** 069 * <p>Name of the updated AttributeDefinition.</p> 070 * @param attributeName value to be set 071 * @return Builder 072 */ 073 074 public ChangeIsSearchableChangeBuilder attributeName(final String attributeName) { 075 this.attributeName = attributeName; 076 return this; 077 } 078 079 /** 080 * value of change} 081 * @return change 082 */ 083 084 public String getChange() { 085 return this.change; 086 } 087 088 /** 089 * <p>Value before the change.</p> 090 * @return previousValue 091 */ 092 093 public Boolean getPreviousValue() { 094 return this.previousValue; 095 } 096 097 /** 098 * <p>Value after the change.</p> 099 * @return nextValue 100 */ 101 102 public Boolean getNextValue() { 103 return this.nextValue; 104 } 105 106 /** 107 * <p>Name of the updated AttributeDefinition.</p> 108 * @return attributeName 109 */ 110 111 public String getAttributeName() { 112 return this.attributeName; 113 } 114 115 /** 116 * builds ChangeIsSearchableChange with checking for non-null required values 117 * @return ChangeIsSearchableChange 118 */ 119 public ChangeIsSearchableChange build() { 120 Objects.requireNonNull(change, ChangeIsSearchableChange.class + ": change is missing"); 121 Objects.requireNonNull(previousValue, ChangeIsSearchableChange.class + ": previousValue is missing"); 122 Objects.requireNonNull(nextValue, ChangeIsSearchableChange.class + ": nextValue is missing"); 123 Objects.requireNonNull(attributeName, ChangeIsSearchableChange.class + ": attributeName is missing"); 124 return new ChangeIsSearchableChangeImpl(change, previousValue, nextValue, attributeName); 125 } 126 127 /** 128 * builds ChangeIsSearchableChange without checking for non-null required values 129 * @return ChangeIsSearchableChange 130 */ 131 public ChangeIsSearchableChange buildUnchecked() { 132 return new ChangeIsSearchableChangeImpl(change, previousValue, nextValue, attributeName); 133 } 134 135 /** 136 * factory method for an instance of ChangeIsSearchableChangeBuilder 137 * @return builder 138 */ 139 public static ChangeIsSearchableChangeBuilder of() { 140 return new ChangeIsSearchableChangeBuilder(); 141 } 142 143 /** 144 * create builder for ChangeIsSearchableChange instance 145 * @param template instance with prefilled values for the builder 146 * @return builder 147 */ 148 public static ChangeIsSearchableChangeBuilder of(final ChangeIsSearchableChange template) { 149 ChangeIsSearchableChangeBuilder builder = new ChangeIsSearchableChangeBuilder(); 150 builder.change = template.getChange(); 151 builder.previousValue = template.getPreviousValue(); 152 builder.nextValue = template.getNextValue(); 153 builder.attributeName = template.getAttributeName(); 154 return builder; 155 } 156 157}