All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.history.models.label.CustomerLabelBuilder Maven / Gradle / Ivy

There is a newer version: 17.11.0
Show newest version

package com.commercetools.history.models.label;

import java.util.*;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;

/**
 * CustomerLabelBuilder
 * 
* Example to create an instance using the builder pattern *
*

 *     CustomerLabel customerLabel = CustomerLabel.builder()
 *             .firstName("{firstName}")
 *             .lastName("{lastName}")
 *             .customerNumber("{customerNumber}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class CustomerLabelBuilder implements Builder { private String firstName; private String lastName; private String customerNumber; /** *

Given name (first name) of the Customer.

* @param firstName value to be set * @return Builder */ public CustomerLabelBuilder firstName(final String firstName) { this.firstName = firstName; return this; } /** *

Family name (last name) of the Customer.

* @param lastName value to be set * @return Builder */ public CustomerLabelBuilder lastName(final String lastName) { this.lastName = lastName; return this; } /** *

User-defined unique identifier of the Customer.

* @param customerNumber value to be set * @return Builder */ public CustomerLabelBuilder customerNumber(final String customerNumber) { this.customerNumber = customerNumber; return this; } /** *

Given name (first name) of the Customer.

* @return firstName */ public String getFirstName() { return this.firstName; } /** *

Family name (last name) of the Customer.

* @return lastName */ public String getLastName() { return this.lastName; } /** *

User-defined unique identifier of the Customer.

* @return customerNumber */ public String getCustomerNumber() { return this.customerNumber; } /** * builds CustomerLabel with checking for non-null required values * @return CustomerLabel */ public CustomerLabel build() { Objects.requireNonNull(firstName, CustomerLabel.class + ": firstName is missing"); Objects.requireNonNull(lastName, CustomerLabel.class + ": lastName is missing"); Objects.requireNonNull(customerNumber, CustomerLabel.class + ": customerNumber is missing"); return new CustomerLabelImpl(firstName, lastName, customerNumber); } /** * builds CustomerLabel without checking for non-null required values * @return CustomerLabel */ public CustomerLabel buildUnchecked() { return new CustomerLabelImpl(firstName, lastName, customerNumber); } /** * factory method for an instance of CustomerLabelBuilder * @return builder */ public static CustomerLabelBuilder of() { return new CustomerLabelBuilder(); } /** * create builder for CustomerLabel instance * @param template instance with prefilled values for the builder * @return builder */ public static CustomerLabelBuilder of(final CustomerLabel template) { CustomerLabelBuilder builder = new CustomerLabelBuilder(); builder.firstName = template.getFirstName(); builder.lastName = template.getLastName(); builder.customerNumber = template.getCustomerNumber(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy