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

com.commercetools.history.models.common.LocationBuilder Maven / Gradle / Ivy

There is a newer version: 17.12.0
Show newest version

package com.commercetools.history.models.common;

import java.util.*;

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

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

 *     Location location = Location.builder()
 *             .country("{country}")
 *             .state("{state}")
 *             .build()
 * 
*
*/ @Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") public class LocationBuilder implements Builder { private String country; private String state; /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* @param country value to be set * @return Builder */ public LocationBuilder country(final String country) { this.country = country; return this; } /** * set the value to the state * @param state value to be set * @return Builder */ public LocationBuilder state(final String state) { this.state = state; return this; } /** *

Two-digit country code as per ISO 3166-1 alpha-2.

* @return country */ public String getCountry() { return this.country; } /** * value of state} * @return state */ public String getState() { return this.state; } /** * builds Location with checking for non-null required values * @return Location */ public Location build() { Objects.requireNonNull(country, Location.class + ": country is missing"); Objects.requireNonNull(state, Location.class + ": state is missing"); return new LocationImpl(country, state); } /** * builds Location without checking for non-null required values * @return Location */ public Location buildUnchecked() { return new LocationImpl(country, state); } /** * factory method for an instance of LocationBuilder * @return builder */ public static LocationBuilder of() { return new LocationBuilder(); } /** * create builder for Location instance * @param template instance with prefilled values for the builder * @return builder */ public static LocationBuilder of(final Location template) { LocationBuilder builder = new LocationBuilder(); builder.country = template.getCountry(); builder.state = template.getState(); return builder; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy