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

io.sphere.sdk.orders.OrderLike Maven / Gradle / Ivy

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

import com.neovisionaries.i18n.CountryCode;
import io.sphere.sdk.carts.CustomLineItem;
import io.sphere.sdk.carts.LineItem;
import io.sphere.sdk.carts.TaxedPrice;
import io.sphere.sdk.customergroups.CustomerGroup;
import io.sphere.sdk.models.Address;
import io.sphere.sdk.models.DefaultModel;
import io.sphere.sdk.models.Reference;

import javax.money.MonetaryAmount;
import java.util.List;
import java.util.Optional;

public interface OrderLike extends DefaultModel {

    Optional getCustomerId();

    Optional getCustomerEmail();

    List getLineItems();

    List getCustomLineItems();

    default Optional getCustomLineItem(final String customLineItemId) {
        return getCustomLineItems().stream().filter(item -> item.getId().equals(customLineItemId)).findAny();
    }

    default Optional getLineItem(final String lineItemId) {
        return getLineItems().stream().filter(item -> item.getId().equals(lineItemId)).findAny();
    }

    MonetaryAmount getTotalPrice();

    Optional getTaxedPrice();

    Optional
getShippingAddress(); Optional
getBillingAddress(); Optional> getCustomerGroup(); Optional getCountry(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy