io.sphere.sdk.cartdiscounts.CartDiscountDraftDsl 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 com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.cartdiscounts.CartDiscountDraftBuilder;
public final class CartDiscountDraftDsl extends io.sphere.sdk.models.Base implements CartDiscountDraft {
private final java.lang.String cartPredicate;
@Nullable()
private final io.sphere.sdk.models.LocalizedString description;
@JsonProperty("isActive")
private final java.lang.Boolean active;
private final io.sphere.sdk.models.LocalizedString name;
@JsonProperty("requiresDiscountCode")
private final java.lang.Boolean requiresDiscountCode;
private final java.lang.String sortOrder;
private final io.sphere.sdk.cartdiscounts.CartDiscountTarget target;
@Nullable()
private final java.time.ZonedDateTime validFrom;
@Nullable()
private final java.time.ZonedDateTime validUntil;
private final io.sphere.sdk.cartdiscounts.CartDiscountValue value;
@JsonCreator()
CartDiscountDraftDsl(@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;
}
@JsonProperty("isActive")
public java.lang.Boolean isActive() {
return active;
}
public java.lang.String getCartPredicate() {
return cartPredicate;
}
@Nullable()
public io.sphere.sdk.models.LocalizedString getDescription() {
return description;
}
public io.sphere.sdk.models.LocalizedString getName() {
return name;
}
@JsonProperty("requiresDiscountCode")
public java.lang.Boolean isRequiresDiscountCode() {
return requiresDiscountCode;
}
public java.lang.String getSortOrder() {
return sortOrder;
}
public io.sphere.sdk.cartdiscounts.CartDiscountTarget getTarget() {
return target;
}
@Nullable()
public java.time.ZonedDateTime getValidFrom() {
return validFrom;
}
@Nullable()
public java.time.ZonedDateTime getValidUntil() {
return validUntil;
}
public io.sphere.sdk.cartdiscounts.CartDiscountValue getValue() {
return value;
}
public CartDiscountDraftDsl withCartPredicate(final java.lang.String cartPredicate) {
return newBuilder().cartPredicate(cartPredicate).build();
}
public CartDiscountDraftDsl withDescription(@Nullable() final io.sphere.sdk.models.LocalizedString description) {
return newBuilder().description(description).build();
}
public CartDiscountDraftDsl withActive(final java.lang.Boolean active) {
return newBuilder().active(active).build();
}
public CartDiscountDraftDsl withIsActive(final java.lang.Boolean active) {
return newBuilder().active(active).build();
}
public CartDiscountDraftDsl withName(final io.sphere.sdk.models.LocalizedString name) {
return newBuilder().name(name).build();
}
public CartDiscountDraftDsl withRequiresDiscountCode(final java.lang.Boolean requiresDiscountCode) {
return newBuilder().requiresDiscountCode(requiresDiscountCode).build();
}
public CartDiscountDraftDsl withIsRequiresDiscountCode(final java.lang.Boolean requiresDiscountCode) {
return newBuilder().requiresDiscountCode(requiresDiscountCode).build();
}
public CartDiscountDraftDsl withSortOrder(final java.lang.String sortOrder) {
return newBuilder().sortOrder(sortOrder).build();
}
public CartDiscountDraftDsl withTarget(final io.sphere.sdk.cartdiscounts.CartDiscountTarget target) {
return newBuilder().target(target).build();
}
public CartDiscountDraftDsl withValidFrom(@Nullable() final java.time.ZonedDateTime validFrom) {
return newBuilder().validFrom(validFrom).build();
}
public CartDiscountDraftDsl withValidUntil(@Nullable() final java.time.ZonedDateTime validUntil) {
return newBuilder().validUntil(validUntil).build();
}
public CartDiscountDraftDsl withValue(final io.sphere.sdk.cartdiscounts.CartDiscountValue value) {
return newBuilder().value(value).build();
}
private CartDiscountDraftBuilder newBuilder() {
return new CartDiscountDraftBuilder(active, cartPredicate, description, name, requiresDiscountCode, sortOrder, target, validFrom, validUntil, value);
}
public static CartDiscountDraftDsl 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 CartDiscountDraftDsl(null, cartPredicate, null, name, requiresDiscountCode, sortOrder, target, null, null, value);
}
public static CartDiscountDraftDsl of(final CartDiscountDraft template) {
return new CartDiscountDraftDsl(template.isActive(), template.getCartPredicate(), template.getDescription(), template.getName(), template.isRequiresDiscountCode(), template.getSortOrder(), template.getTarget(), template.getValidFrom(), template.getValidUntil(), template.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy