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

io.sphere.sdk.shippingmethods.queries.ShippingMethodQuery Maven / Gradle / Ivy

There is a newer version: 1.0.0-M12
Show newest version
package io.sphere.sdk.shippingmethods.queries;

import com.fasterxml.jackson.core.type.TypeReference;
import io.sphere.sdk.models.Referenceable;
import io.sphere.sdk.queries.DefaultModelQuery;
import io.sphere.sdk.queries.PagedQueryResult;
import io.sphere.sdk.queries.QueryDsl;
import io.sphere.sdk.shippingmethods.ShippingMethod;
import io.sphere.sdk.taxcategories.TaxCategory;

public class ShippingMethodQuery extends DefaultModelQuery {
    private ShippingMethodQuery() {
        super(ShippingMethodEndpoint.ENDPOINT.endpoint(), resultTypeReference());
    }

    public static TypeReference> resultTypeReference() {
        return new TypeReference>(){
            @Override
            public String toString() {
                return "TypeReference>";
            }
        };
    }

    public static ShippingMethodQuery of() {
        return new ShippingMethodQuery();
    }

    public static ShippingMethodQueryModel model() {
        return ShippingMethodQueryModel.get();
    }

    public QueryDsl byName(final String name) {
        return withPredicate(model().name().is(name));
    }

    public QueryDsl byTaxCategory(final Referenceable taxCategory) {
        return withPredicate(model().taxCategory().is(taxCategory));
    }

    public QueryDsl byIsDefault() {
        return withPredicate(model().isDefault().is(true));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy