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 * PublishChangeBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * PublishChange publishChange = PublishChange.builder() 016 * .change("{change}") 017 * .build() 018 * </code></pre> 019 * </div> 020 */ 021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") 022public class PublishChangeBuilder implements Builder<PublishChange> { 023 024 private String change; 025 026 /** 027 * set the value to the change 028 * @param change value to be set 029 * @return Builder 030 */ 031 032 public PublishChangeBuilder change(final String change) { 033 this.change = change; 034 return this; 035 } 036 037 /** 038 * value of change} 039 * @return change 040 */ 041 042 public String getChange() { 043 return this.change; 044 } 045 046 /** 047 * builds PublishChange with checking for non-null required values 048 * @return PublishChange 049 */ 050 public PublishChange build() { 051 Objects.requireNonNull(change, PublishChange.class + ": change is missing"); 052 return new PublishChangeImpl(change); 053 } 054 055 /** 056 * builds PublishChange without checking for non-null required values 057 * @return PublishChange 058 */ 059 public PublishChange buildUnchecked() { 060 return new PublishChangeImpl(change); 061 } 062 063 /** 064 * factory method for an instance of PublishChangeBuilder 065 * @return builder 066 */ 067 public static PublishChangeBuilder of() { 068 return new PublishChangeBuilder(); 069 } 070 071 /** 072 * create builder for PublishChange instance 073 * @param template instance with prefilled values for the builder 074 * @return builder 075 */ 076 public static PublishChangeBuilder of(final PublishChange template) { 077 PublishChangeBuilder builder = new PublishChangeBuilder(); 078 builder.change = template.getChange(); 079 return builder; 080 } 081 082}