io.sphere.sdk.shippingmethods.ShippingMethodDraftBuilder Maven / Gradle / Ivy
/*
This class has been generated by class io.sphere.sdk.annotations.processors.ResourceDraftValueAnnotationProcessor
induced by the annotation io.sphere.sdk.annotations.ResourceDraftValue.
in the source class io.sphere.sdk.shippingmethods.ShippingMethodDraft.
*/
package io.sphere.sdk.shippingmethods;
import javax.annotation.Nullable;
import io.sphere.sdk.models.*;
import java.util.*;
import io.sphere.sdk.utils.*;
import com.fasterxml.jackson.annotation.*;
import io.sphere.sdk.models.Builder;
import com.fasterxml.jackson.annotation.JsonCreator;
/** Builder for {@link ShippingMethodDraft}. */
public final class ShippingMethodDraftBuilder extends io.sphere.sdk.models.Base implements Builder {
private java.lang.String name;
@Nullable()
private java.lang.String description;
private io.sphere.sdk.models.Reference taxCategory;
private java.util.List zoneRates;
@JsonProperty("isDefault")
private java.lang.Boolean _default;
@JsonCreator()
ShippingMethodDraftBuilder(@com.fasterxml.jackson.annotation.JsonProperty("isDefault") final java.lang.Boolean _default, final java.lang.String description, final java.lang.String name, final io.sphere.sdk.models.Reference taxCategory, final java.util.List zoneRates) {
this._default = _default;
this.description = description;
this.name = name;
this.taxCategory = taxCategory;
this.zoneRates = zoneRates;
}
public ShippingMethodDraftBuilder name(final java.lang.String name) {
this.name = name;
return this;
}
public ShippingMethodDraftBuilder description(@Nullable() final java.lang.String description) {
this.description = description;
return this;
}
public ShippingMethodDraftBuilder taxCategory(final io.sphere.sdk.models.Referenceable taxCategory) {
this.taxCategory = Optional.ofNullable(taxCategory).map(Referenceable::toReference).orElse(null);
return this;
}
public ShippingMethodDraftBuilder zoneRates(final java.util.List zoneRates) {
this.zoneRates = zoneRates;
return this;
}
public ShippingMethodDraftBuilder _default(final java.lang.Boolean _default) {
this._default = _default;
return this;
}
public ShippingMethodDraftBuilder isDefault(final java.lang.Boolean _default) {
this._default = _default;
return this;
}
public ShippingMethodDraftDsl build() {
return new ShippingMethodDraftDsl(_default, description, name, taxCategory, zoneRates);
}
public static ShippingMethodDraftBuilder of(final java.lang.String name, final java.lang.String description, final io.sphere.sdk.models.Reference taxCategory, final java.util.List zoneRates, final java.lang.Boolean _default) {
return new ShippingMethodDraftBuilder(_default, description, name, taxCategory, zoneRates);
}
public static ShippingMethodDraftBuilder of(final java.lang.String name, final io.sphere.sdk.models.Reference taxCategory, final java.util.List zoneRates, final java.lang.Boolean _default) {
return new ShippingMethodDraftBuilder(_default, null, name, taxCategory, zoneRates);
}
public static ShippingMethodDraftBuilder of(final ShippingMethodDraft template) {
return new ShippingMethodDraftBuilder(template.isDefault(), template.getDescription(), template.getName(), template.getTaxCategory(), template.getZoneRates());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy