001 002package com.commercetools.history.models.label; 003 004import java.util.*; 005 006import io.vrap.rmf.base.client.Builder; 007import io.vrap.rmf.base.client.utils.Generated; 008 009/** 010 * StringLabelBuilder 011 * <hr> 012 * Example to create an instance using the builder pattern 013 * <div class=code-example> 014 * <pre><code class='java'> 015 * StringLabel stringLabel = StringLabel.builder() 016 * .value("{value}") 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 StringLabelBuilder implements Builder<StringLabel> { 023 024 private String value; 025 026 /** 027 * <p>Changed value.</p> 028 * @param value value to be set 029 * @return Builder 030 */ 031 032 public StringLabelBuilder value(final String value) { 033 this.value = value; 034 return this; 035 } 036 037 /** 038 * <p>Changed value.</p> 039 * @return value 040 */ 041 042 public String getValue() { 043 return this.value; 044 } 045 046 /** 047 * builds StringLabel with checking for non-null required values 048 * @return StringLabel 049 */ 050 public StringLabel build() { 051 Objects.requireNonNull(value, StringLabel.class + ": value is missing"); 052 return new StringLabelImpl(value); 053 } 054 055 /** 056 * builds StringLabel without checking for non-null required values 057 * @return StringLabel 058 */ 059 public StringLabel buildUnchecked() { 060 return new StringLabelImpl(value); 061 } 062 063 /** 064 * factory method for an instance of StringLabelBuilder 065 * @return builder 066 */ 067 public static StringLabelBuilder of() { 068 return new StringLabelBuilder(); 069 } 070 071 /** 072 * create builder for StringLabel instance 073 * @param template instance with prefilled values for the builder 074 * @return builder 075 */ 076 public static StringLabelBuilder of(final StringLabel template) { 077 StringLabelBuilder builder = new StringLabelBuilder(); 078 builder.value = template.getValue(); 079 return builder; 080 } 081 082}