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