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

io.sphere.sdk.shippingmethods.expansion.ShippingMethodExpansionModel Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
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<>();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy