io.sphere.sdk.orders.ParcelDraftDsl Maven / Gradle / Ivy
package io.sphere.sdk.orders;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.types.CustomFieldsDraft;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nullable;
/**
* Dsl class for {@link ParcelDraft}.
*/
@Generated(
value = "io.sphere.sdk.annotations.processors.generators.ResourceDraftValueGenerator",
comments = "Generated from: io.sphere.sdk.orders.ParcelDraft"
)
public final class ParcelDraftDsl extends Base implements ParcelDraft {
@Nullable
private CustomFieldsDraft custom;
@Nullable
private List items;
@Nullable
private ParcelMeasurements measurements;
@Nullable
private TrackingData trackingData;
@JsonCreator
ParcelDraftDsl(@Nullable final CustomFieldsDraft custom, @Nullable final List items,
@Nullable final ParcelMeasurements measurements, @Nullable final TrackingData trackingData) {
this.custom = custom;
this.items = items;
this.measurements = measurements;
this.trackingData = trackingData;
}
@Nullable
public CustomFieldsDraft getCustom() {
return custom;
}
@Nullable
public List getItems() {
return items;
}
@Nullable
public ParcelMeasurements getMeasurements() {
return measurements;
}
@Nullable
public TrackingData getTrackingData() {
return trackingData;
}
/**
* Creates a new builder with the values of this object.
*
* @return new builder
*/
public ParcelDraftBuilder newBuilder() {
return new ParcelDraftBuilder(custom, items, measurements, trackingData);
}
public ParcelDraftDsl withCustom(@Nullable final CustomFieldsDraft custom) {
return newBuilder().custom(custom).build();
}
public ParcelDraftDsl withItems(@Nullable final List items) {
return newBuilder().items(items).build();
}
public ParcelDraftDsl withMeasurements(@Nullable final ParcelMeasurements measurements) {
return newBuilder().measurements(measurements).build();
}
public ParcelDraftDsl withTrackingData(@Nullable final TrackingData trackingData) {
return newBuilder().trackingData(trackingData).build();
}
/**
* Creates a new object initialized with the given values.
*
* @return new object initialized with the given values
*/
public static ParcelDraftDsl of() {
return new ParcelDraftDsl(null, null, null, null);
}
/**
* 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 ParcelDraftDsl of(final ParcelDraft template) {
return new ParcelDraftDsl(template.getCustom(), template.getItems(), template.getMeasurements(), template.getTrackingData());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy