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

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

There is a newer version: 17.15.1
Show newest version

package com.commercetools.history.models.label;

import java.util.*;
import java.util.function.Function;

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

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

 *     QuoteRequestLabel quoteRequestLabel = QuoteRequestLabel.builder()
 *             .key("{key}")
 *             .customer(customerBuilder -> customerBuilder)
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class QuoteRequestLabelBuilder implements Builder { private String key; private com.commercetools.history.models.common.Reference customer; /** *

User-defined unique identifier of the Quote Request.

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

The Buyer who raised the Quote Request.

* @param builder function to build the customer value * @return Builder */ public QuoteRequestLabelBuilder customer( Function builder) { this.customer = builder.apply(com.commercetools.history.models.common.ReferenceBuilder.of()).build(); return this; } /** *

The Buyer who raised the Quote Request.

* @param builder function to build the customer value * @return Builder */ public QuoteRequestLabelBuilder withCustomer( Function builder) { this.customer = builder.apply(com.commercetools.history.models.common.ReferenceBuilder.of()); return this; } /** *

The Buyer who raised the Quote Request.

* @param customer value to be set * @return Builder */ public QuoteRequestLabelBuilder customer(final com.commercetools.history.models.common.Reference customer) { this.customer = customer; return this; } /** *

User-defined unique identifier of the Quote Request.

* @return key */ public String getKey() { return this.key; } /** *

The Buyer who raised the Quote Request.

* @return customer */ public com.commercetools.history.models.common.Reference getCustomer() { return this.customer; } /** * builds QuoteRequestLabel with checking for non-null required values * @return QuoteRequestLabel */ public QuoteRequestLabel build() { Objects.requireNonNull(key, QuoteRequestLabel.class + ": key is missing"); Objects.requireNonNull(customer, QuoteRequestLabel.class + ": customer is missing"); return new QuoteRequestLabelImpl(key, customer); } /** * builds QuoteRequestLabel without checking for non-null required values * @return QuoteRequestLabel */ public QuoteRequestLabel buildUnchecked() { return new QuoteRequestLabelImpl(key, customer); } /** * factory method for an instance of QuoteRequestLabelBuilder * @return builder */ public static QuoteRequestLabelBuilder of() { return new QuoteRequestLabelBuilder(); } /** * create builder for QuoteRequestLabel instance * @param template instance with prefilled values for the builder * @return builder */ public static QuoteRequestLabelBuilder of(final QuoteRequestLabel template) { QuoteRequestLabelBuilder builder = new QuoteRequestLabelBuilder(); builder.key = template.getKey(); builder.customer = template.getCustomer(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy