com.commercetools.history.models.common.StoreCountryBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commercetools-sdk-java-history Show documentation
Show all versions of commercetools-sdk-java-history Show documentation
The e-commerce SDK from commercetools Composable Commerce for Java
package com.commercetools.history.models.common;
import java.util.*;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* StoreCountryBuilder
*
* Example to create an instance using the builder pattern
*
*
* StoreCountry storeCountry = StoreCountry.builder()
* .code("{code}")
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class StoreCountryBuilder implements Builder {
private String code;
/**
* Two-digit country code as per ISO 3166-1 alpha-2.
* @param code value to be set
* @return Builder
*/
public StoreCountryBuilder code(final String code) {
this.code = code;
return this;
}
/**
* Two-digit country code as per ISO 3166-1 alpha-2.
* @return code
*/
public String getCode() {
return this.code;
}
/**
* builds StoreCountry with checking for non-null required values
* @return StoreCountry
*/
public StoreCountry build() {
Objects.requireNonNull(code, StoreCountry.class + ": code is missing");
return new StoreCountryImpl(code);
}
/**
* builds StoreCountry without checking for non-null required values
* @return StoreCountry
*/
public StoreCountry buildUnchecked() {
return new StoreCountryImpl(code);
}
/**
* factory method for an instance of StoreCountryBuilder
* @return builder
*/
public static StoreCountryBuilder of() {
return new StoreCountryBuilder();
}
/**
* create builder for StoreCountry instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static StoreCountryBuilder of(final StoreCountry template) {
StoreCountryBuilder builder = new StoreCountryBuilder();
builder.code = template.getCode();
return builder;
}
}