io.sphere.sdk.shippingmethods.expansion.ShippingMethodExpansionModel Maven / Gradle / Ivy
package io.sphere.sdk.shippingmethods.expansion;
import io.sphere.sdk.expansion.ExpansionModel;
import io.sphere.sdk.expansion.ExpansionPath;
import io.sphere.sdk.shippingmethods.ShippingMethod;
import javax.annotation.Nullable;
/**
DSL class to create expansion path expressions.
@param the type for which the expansion path is
*/
public class ShippingMethodExpansionModel extends ExpansionModel {
public ShippingMethodExpansionModel(@Nullable final String parentPath, @Nullable final String path) {
super(parentPath, path);
}
ShippingMethodExpansionModel() {
super();
}
public ExpansionPath taxCategory() {
return expansionPath("taxCategory");
}
public ZoneRateExpansionModel zoneRates() {
return zoneRates("*");
}
public ZoneRateExpansionModel zoneRates(final int index) {
return zoneRates("" + index);
}
public ExpansionPath zones() {
return zoneRates().zone();
}
public ExpansionPath zones(final int index) {
return zoneRates(index).zone();
}
private ZoneRateExpansionModel zoneRates(final String s) {
return new ZoneRateExpansionModel<>(pathExpression(), "zoneRates[" + s + "]");
}
public static ShippingMethodExpansionModel of() {
return new ShippingMethodExpansionModel<>();
}
}