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

io.sphere.sdk.carts.expansion.CartLikeExpansionModel Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.carts.expansion;

import io.sphere.sdk.expansion.ExpansionModel;
import io.sphere.sdk.expansion.ExpansionPath;

public abstract class CartLikeExpansionModel extends ExpansionModel {
    protected CartLikeExpansionModel(final String parentPath, final String path) {
        super(parentPath, path);
    }

    protected CartLikeExpansionModel() {
        super();
    }

    public ExpansionPath customerGroup() {
        return expansionPath("customerGroup");
    }

    public DiscountCodeInfoExpansionModel discountCodes() {
        return discountCodes("*");
    }

    public DiscountCodeInfoExpansionModel discountCodes(final int index) {
        return discountCodes("" + index);
    }

    public LineItemExpansionModel lineItems() {
        return new LineItemExpansionModel<>(pathExpression(), "lineItems[*]");
    }

    public LineItemExpansionModel lineItems(final int index) {
        return new LineItemExpansionModel<>(pathExpression(), "lineItems[" + index + "]");
    }

    private DiscountCodeInfoExpansionModel discountCodes(final String s) {
        return new DiscountCodeInfoExpansionModel<>(pathExpression(), "discountCodes[" + s + "]");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy