io.sphere.sdk.cartdiscounts.CartDiscountDraftBuilder 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.cartdiscounts.CartDiscountDraft.
*/
package io.sphere.sdk.cartdiscounts;
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 CartDiscountDraft}. */
public final class CartDiscountDraftBuilder extends io.sphere.sdk.models.Base implements Builder {
private java.lang.String cartPredicate;
@Nullable()
private io.sphere.sdk.models.LocalizedString description;
@JsonProperty("isActive")
private java.lang.Boolean active;
private io.sphere.sdk.models.LocalizedString name;
@JsonProperty("requiresDiscountCode")
private java.lang.Boolean requiresDiscountCode;
private java.lang.String sortOrder;
private io.sphere.sdk.cartdiscounts.CartDiscountTarget target;
@Nullable()
private java.time.ZonedDateTime validFrom;
@Nullable()
private java.time.ZonedDateTime validUntil;
private io.sphere.sdk.cartdiscounts.CartDiscountValue value;
@JsonCreator()
CartDiscountDraftBuilder(@com.fasterxml.jackson.annotation.JsonProperty("isActive") final java.lang.Boolean active, final java.lang.String cartPredicate, final io.sphere.sdk.models.LocalizedString description, final io.sphere.sdk.models.LocalizedString name, @com.fasterxml.jackson.annotation.JsonProperty("requiresDiscountCode") final java.lang.Boolean requiresDiscountCode, final java.lang.String sortOrder, final io.sphere.sdk.cartdiscounts.CartDiscountTarget target, final java.time.ZonedDateTime validFrom, final java.time.ZonedDateTime validUntil, final io.sphere.sdk.cartdiscounts.CartDiscountValue value) {
this.active = active;
this.cartPredicate = cartPredicate;
this.description = description;
this.name = name;
this.requiresDiscountCode = requiresDiscountCode;
this.sortOrder = sortOrder;
this.target = target;
this.validFrom = validFrom;
this.validUntil = validUntil;
this.value = value;
}
public CartDiscountDraftBuilder cartPredicate(final java.lang.String cartPredicate) {
this.cartPredicate = cartPredicate;
return this;
}
public CartDiscountDraftBuilder description(@Nullable() final io.sphere.sdk.models.LocalizedString description) {
this.description = description;
return this;
}
public CartDiscountDraftBuilder active(final java.lang.Boolean active) {
this.active = active;
return this;
}
public CartDiscountDraftBuilder isActive(final java.lang.Boolean active) {
this.active = active;
return this;
}
public CartDiscountDraftBuilder name(final io.sphere.sdk.models.LocalizedString name) {
this.name = name;
return this;
}
public CartDiscountDraftBuilder requiresDiscountCode(final java.lang.Boolean requiresDiscountCode) {
this.requiresDiscountCode = requiresDiscountCode;
return this;
}
public CartDiscountDraftBuilder isRequiresDiscountCode(final java.lang.Boolean requiresDiscountCode) {
this.requiresDiscountCode = requiresDiscountCode;
return this;
}
public CartDiscountDraftBuilder sortOrder(final java.lang.String sortOrder) {
this.sortOrder = sortOrder;
return this;
}
public CartDiscountDraftBuilder target(final io.sphere.sdk.cartdiscounts.CartDiscountTarget target) {
this.target = target;
return this;
}
public CartDiscountDraftBuilder validFrom(@Nullable() final java.time.ZonedDateTime validFrom) {
this.validFrom = validFrom;
return this;
}
public CartDiscountDraftBuilder validUntil(@Nullable() final java.time.ZonedDateTime validUntil) {
this.validUntil = validUntil;
return this;
}
public CartDiscountDraftBuilder value(final io.sphere.sdk.cartdiscounts.CartDiscountValue value) {
this.value = value;
return this;
}
public CartDiscountDraftDsl build() {
return new CartDiscountDraftDsl(active, cartPredicate, description, name, requiresDiscountCode, sortOrder, target, validFrom, validUntil, value);
}
public static CartDiscountDraftBuilder of(final io.sphere.sdk.models.LocalizedString name, final java.lang.String cartPredicate, final io.sphere.sdk.cartdiscounts.CartDiscountValue value, final io.sphere.sdk.cartdiscounts.CartDiscountTarget target, final java.lang.String sortOrder, final boolean requiresDiscountCode) {
return new CartDiscountDraftBuilder(null, cartPredicate, null, name, requiresDiscountCode, sortOrder, target, null, null, value);
}
public static CartDiscountDraftBuilder of(final CartDiscountDraft template) {
return new CartDiscountDraftBuilder(template.isActive(), template.getCartPredicate(), template.getDescription(), template.getName(), template.isRequiresDiscountCode(), template.getSortOrder(), template.getTarget(), template.getValidFrom(), template.getValidUntil(), template.getValue());
}
public CartDiscountDraftBuilder cartPredicate(final CartDiscountPredicate cartPredicate) {
this.cartPredicate = cartPredicate.toSphereCartPredicate();
return this;
}
public static CartDiscountDraftBuilder of(final io.sphere.sdk.models.LocalizedString name, final CartDiscountPredicate cartPredicate, final io.sphere.sdk.cartdiscounts.CartDiscountValue value, final io.sphere.sdk.cartdiscounts.CartDiscountTarget target, final java.lang.String sortOrder, final boolean requiresDiscountCode) {
return of(name, cartPredicate.toSphereCartPredicate(), value, target, sortOrder, requiresDiscountCode);
}
public CartDiscountDraftBuilder active(final boolean active) {
this.active = active;
return this;
}
public CartDiscountDraftBuilder isActive(final boolean active) {
this.active = active;
return this;
}
public CartDiscountDraftBuilder requiresDiscountCode(final boolean requiresDiscountCode) {
this.requiresDiscountCode = requiresDiscountCode;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy