All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.orders.commands.updateactions.ParcelDraft Maven / Gradle / Ivy

There is a newer version: 1.0.0-M12
Show newest version
package io.sphere.sdk.orders.commands.updateactions;

import io.sphere.sdk.models.Base;
import io.sphere.sdk.orders.ParcelMeasurements;
import io.sphere.sdk.orders.TrackingData;

import java.util.Optional;

public class ParcelDraft extends Base {
    private final Optional measurements;
    private final Optional trackingData;

    private ParcelDraft(final Optional measurements, final Optional trackingData) {
        this.measurements = measurements;
        this.trackingData = trackingData;
    }

    public static ParcelDraft of(final Optional measurements, final Optional trackingData) {
        return new ParcelDraft(measurements, trackingData);
    }

    public static ParcelDraft of(final ParcelMeasurements measurements, final TrackingData trackingData) {
        return new ParcelDraft(Optional.of(measurements), Optional.of(trackingData));
    }

    public static ParcelDraft of(final ParcelMeasurements measurements) {
        return new ParcelDraft(Optional.of(measurements), Optional.empty());
    }

    public static ParcelDraft of(final TrackingData trackingData) {
        return new ParcelDraft(Optional.empty(), Optional.of(trackingData));
    }

    public Optional getMeasurements() {
        return measurements;
    }

    public Optional getTrackingData() {
        return trackingData;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy