com.commercetools.history.models.change_value.ShippingMethodChangeValueBuilder 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.change_value;
import java.util.*;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* ShippingMethodChangeValueBuilder
*
* Example to create an instance using the builder pattern
*
*
* ShippingMethodChangeValue shippingMethodChangeValue = ShippingMethodChangeValue.builder()
* .id("{id}")
* .name("{name}")
* .build()
*
*
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ShippingMethodChangeValueBuilder implements Builder {
private String id;
private String name;
/**
* id
of the ShippingMethod.
* @param id value to be set
* @return Builder
*/
public ShippingMethodChangeValueBuilder id(final String id) {
this.id = id;
return this;
}
/**
* Name of the ShippingMethod.
* @param name value to be set
* @return Builder
*/
public ShippingMethodChangeValueBuilder name(final String name) {
this.name = name;
return this;
}
/**
* id
of the ShippingMethod.
* @return id
*/
public String getId() {
return this.id;
}
/**
* Name of the ShippingMethod.
* @return name
*/
public String getName() {
return this.name;
}
/**
* builds ShippingMethodChangeValue with checking for non-null required values
* @return ShippingMethodChangeValue
*/
public ShippingMethodChangeValue build() {
Objects.requireNonNull(id, ShippingMethodChangeValue.class + ": id is missing");
Objects.requireNonNull(name, ShippingMethodChangeValue.class + ": name is missing");
return new ShippingMethodChangeValueImpl(id, name);
}
/**
* builds ShippingMethodChangeValue without checking for non-null required values
* @return ShippingMethodChangeValue
*/
public ShippingMethodChangeValue buildUnchecked() {
return new ShippingMethodChangeValueImpl(id, name);
}
/**
* factory method for an instance of ShippingMethodChangeValueBuilder
* @return builder
*/
public static ShippingMethodChangeValueBuilder of() {
return new ShippingMethodChangeValueBuilder();
}
/**
* create builder for ShippingMethodChangeValue instance
* @param template instance with prefilled values for the builder
* @return builder
*/
public static ShippingMethodChangeValueBuilder of(final ShippingMethodChangeValue template) {
ShippingMethodChangeValueBuilder builder = new ShippingMethodChangeValueBuilder();
builder.id = template.getId();
builder.name = template.getName();
return builder;
}
}