io.sphere.sdk.carts.expansion.CartLikeExpansionModel Maven / Gradle / Ivy
package io.sphere.sdk.carts.expansion;
import io.sphere.sdk.expansion.ExpansionModel;
import io.sphere.sdk.expansion.ExpansionPathContainer;
/**
* Internal base class
* @param context of the reference expansion
*/
public abstract class CartLikeExpansionModel extends ExpansionModel {
protected CartLikeExpansionModel(final String parentPath, final String path) {
super(parentPath, path);
}
protected CartLikeExpansionModel() {
super();
}
public ExpansionPathContainer 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 + "]");
}
public PaymentInfoExpansionModel paymentInfo() {
return new PaymentInfoExpansionModel<>(buildPathExpression(), "paymentInfo");
}
private DiscountCodeInfoExpansionModel discountCodes(final String s) {
return new DiscountCodeInfoExpansionModel<>(pathExpression(), "discountCodes[" + s + "]");
}
public ShippingInfoExpansionModel shippingInfo() {
return new ShippingInfoExpansionModel<>(pathExpression(), "shippingInfo");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy