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.ExpansionPath;
/**
* 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 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 + "]");
}
public PaymentInfoExpansionModel paymentInfo() {
return new PaymentInfoExpansionModel<>(buildPathExpression(), "paymentInfo");
}
private DiscountCodeInfoExpansionModel discountCodes(final String s) {
return new DiscountCodeInfoExpansionModel<>(pathExpression(), "discountCodes[" + s + "]");
}
}