io.sphere.sdk.shippingmethods.CartClassificationBuilder Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.shippingmethods;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Builder;
import java.lang.Boolean;
import java.lang.String;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.money.MonetaryAmount;
/**
* Builder for {@link CartClassification}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.HasBuilderGenerator",
comments = "Generated from: io.sphere.sdk.shippingmethods.CartClassification"
)
public final class CartClassificationBuilder extends Base implements Builder {
@Nullable
private Boolean matching;
private MonetaryAmount price;
private String type;
private String value;
CartClassificationBuilder() {
}
CartClassificationBuilder(@Nullable final Boolean matching, final MonetaryAmount price,
final String type, final String value) {
this.matching = matching;
this.price = price;
this.type = type;
this.value = value;
}
/**
* Sets the {@code matching} property of this builder.
*
* @param matching the value for {@link ShippingRatePriceTier#isMatching()}
* @return this builder
*/
public CartClassificationBuilder matching(@Nullable final Boolean matching) {
this.matching = matching;
return this;
}
/**
* Sets the {@code matching} property of this builder.
*
* @param matching the value for {@link ShippingRatePriceTier#isMatching()}
* @return this builder
*/
public CartClassificationBuilder isMatching(@Nullable final Boolean matching) {
this.matching = matching;
return this;
}
/**
* Sets the {@code price} property of this builder.
*
* @param price the value for {@link ShippingRatePriceTier#getPrice()}
* @return this builder
*/
public CartClassificationBuilder price(final MonetaryAmount price) {
this.price = price;
return this;
}
/**
* Sets the {@code type} property of this builder.
*
* @param type the value for {@link ShippingRatePriceTier#getType()}
* @return this builder
*/
public CartClassificationBuilder type(final String type) {
this.type = type;
return this;
}
/**
* Sets the {@code value} property of this builder.
*
* @param value the value for {@link CartClassification#getValue()}
* @return this builder
*/
public CartClassificationBuilder value(final String value) {
this.value = value;
return this;
}
/**
* Creates a new instance of {@code CartClassification} with the values of this builder.
*
* @return the instance
*/
public CartClassification build() {
return new CartClassificationImpl(matching, price, type, value);
}
/**
* Creates a new object initialized with the given values.
*
* @param value initial value for the {@link CartClassification#getValue()} property
* @param price initial value for the {@link ShippingRatePriceTier#getPrice()} property
* @return new object initialized with the given values
*/
public static CartClassificationBuilder of(final String value, final MonetaryAmount price) {
return new CartClassificationBuilder(null, price, null, value);
}
/**
* Creates a new object initialized with the fields of the template parameter.
*
* @param template the template
* @return a new object initialized from the template
*/
public static CartClassificationBuilder of(final CartClassification template) {
return new CartClassificationBuilder(template.isMatching(), template.getPrice(), template.getType(), template.getValue());
}
}