io.sphere.sdk.shippingmethods.ShippingMethodDraftDsl Maven / Gradle / Ivy
The newest version!
package io.sphere.sdk.shippingmethods;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.LocalizedString;
import io.sphere.sdk.models.ResourceIdentifier;
import io.sphere.sdk.taxcategories.TaxCategory;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.lang.Boolean;
import java.lang.Deprecated;
import java.lang.String;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link ShippingMethodDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.shippingmethods.ShippingMethodDraft"
)
public final class ShippingMethodDraftDsl extends Base implements ShippingMethodDraft {
private Boolean _default;
@Nullable
private CustomFieldsDraft custom;
@Nullable
private String description;
@Nullable
private String key;
@Nullable
private LocalizedString localizedDescription;
@Nullable
private LocalizedString localizedName;
private String name;
@Nullable
private String predicate;
private ResourceIdentifier taxCategory;
private List zoneRates;
@JsonCreator
ShippingMethodDraftDsl(@JsonProperty("isDefault") final Boolean _default,
@Nullable final CustomFieldsDraft custom, @Nullable final String description,
@Nullable final String key, @Nullable final LocalizedString localizedDescription,
@Nullable final LocalizedString localizedName, final String name,
@Nullable final String predicate, final ResourceIdentifier taxCategory,
final List zoneRates) {
this._default = _default;
this.custom = custom;
this.description = description;
this.key = key;
this.localizedDescription = localizedDescription;
this.localizedName = localizedName;
this.name = name;
this.predicate = predicate;
this.taxCategory = taxCategory;
this.zoneRates = zoneRates;
}
@JsonProperty("isDefault")
public Boolean isDefault() {
return _default;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
/**
*
* @deprecated This method will be removed with the next major SDK update.
*/
@Nullable
@Deprecated
public String getDescription() {
return description;
}
@Nullable
public String getKey() {
return key;
}
@Nullable
public LocalizedString getLocalizedDescription() {
return localizedDescription;
}
@Nullable
public LocalizedString getLocalizedName() {
return localizedName;
}
public String getName() {
return name;
}
@Nullable
public String getPredicate() {
return predicate;
}
public ResourceIdentifier getTaxCategory() {
return taxCategory;
}
public List getZoneRates() {
return zoneRates;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public ShippingMethodDraftBuilder newBuilder() {
return new ShippingMethodDraftBuilder(_default, custom, description, key, localizedDescription, localizedName, name, predicate, taxCategory, zoneRates);
}
public ShippingMethodDraftDsl withDefault(final Boolean _default) {
return newBuilder()._default(_default).build();
}
public ShippingMethodDraftDsl withCustom(@Nullable final CustomFieldsDraft custom) {
return newBuilder().custom(custom).build();
}
/**
*
* @deprecated This method will be removed with the next major SDK update.
*/
@Deprecated
public ShippingMethodDraftDsl withDescription(@Nullable final String description) {
return newBuilder().description(description).build();
}
public ShippingMethodDraftDsl withKey(@Nullable final String key) {
return newBuilder().key(key).build();
}
public ShippingMethodDraftDsl withLocalizedDescription(
@Nullable final LocalizedString localizedDescription) {
return newBuilder().localizedDescription(localizedDescription).build();
}
public ShippingMethodDraftDsl withLocalizedName(@Nullable final LocalizedString localizedName) {
return newBuilder().localizedName(localizedName).build();
}
public ShippingMethodDraftDsl withName(final String name) {
return newBuilder().name(name).build();
}
public ShippingMethodDraftDsl withPredicate(@Nullable final String predicate) {
return newBuilder().predicate(predicate).build();
}
public ShippingMethodDraftDsl withTaxCategory(final ResourceIdentifier taxCategory) {
return newBuilder().taxCategory(taxCategory).build();
}
public ShippingMethodDraftDsl withZoneRates(final List zoneRates) {
return newBuilder().zoneRates(zoneRates).build();
}
public ShippingMethodDraftDsl withIsDefault(final Boolean _default) {
return newBuilder()._default(_default).build();
}
/**
* Creates a new object initialized with the given values.
*
* @param name initial value for the {@link ShippingMethodDraft#getName()} property
* @param description initial value for the {@link ShippingMethodDraft#getDescription()} property
* @param taxCategory initial value for the {@link ShippingMethodDraft#getTaxCategory()} property
* @param zoneRates initial value for the {@link ShippingMethodDraft#getZoneRates()} property
* @param _default initial value for the {@link ShippingMethodDraft#isDefault()} property
* @return new object initialized with the given values
*/
public static ShippingMethodDraftDsl of(final String name, @Nullable final String description,
final ResourceIdentifier taxCategory, final List zoneRates,
final Boolean _default) {
return new ShippingMethodDraftDsl(_default, null, description, null, null, null, name, null, taxCategory, zoneRates);
}
/**
* Creates a new object initialized with the given values.
*
* @param name initial value for the {@link ShippingMethodDraft#getName()} property
* @param taxCategory initial value for the {@link ShippingMethodDraft#getTaxCategory()} property
* @param zoneRates initial value for the {@link ShippingMethodDraft#getZoneRates()} property
* @param _default initial value for the {@link ShippingMethodDraft#isDefault()} property
* @return new object initialized with the given values
*/
public static ShippingMethodDraftDsl of(final String name,
final ResourceIdentifier taxCategory, final List zoneRates,
final Boolean _default) {
return new ShippingMethodDraftDsl(_default, null, null, null, null, null, name, null, taxCategory, zoneRates);
}
/**
* Creates a new object initialized with the given values.
*
* @param name initial value for the {@link ShippingMethodDraft#getName()} property
* @param localizedDescription initial value for the {@link ShippingMethodDraft#getLocalizedDescription()} property
* @param taxCategory initial value for the {@link ShippingMethodDraft#getTaxCategory()} property
* @param zoneRates initial value for the {@link ShippingMethodDraft#getZoneRates()} property
* @param _default initial value for the {@link ShippingMethodDraft#isDefault()} property
* @return new object initialized with the given values
*/
public static ShippingMethodDraftDsl of(final String name,
@Nullable final LocalizedString localizedDescription,
final ResourceIdentifier taxCategory, final List zoneRates,
final Boolean _default) {
return new ShippingMethodDraftDsl(_default, null, null, null, localizedDescription, null, name, null, taxCategory, zoneRates);
}
/**
* 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 ShippingMethodDraftDsl of(final ShippingMethodDraft template) {
return new ShippingMethodDraftDsl(template.isDefault(), template.getCustom(), template.getDescription(), template.getKey(), template.getLocalizedDescription(), template.getLocalizedName(), template.getName(), template.getPredicate(), template.getTaxCategory(), template.getZoneRates());
}
}