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

io.sphere.sdk.carts.queries.CartFetchByCustomerId Maven / Gradle / Ivy

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

import io.sphere.sdk.carts.Cart;
import io.sphere.sdk.customers.Customer;
import io.sphere.sdk.models.Identifiable;
import io.sphere.sdk.queries.FetchImpl;
import io.sphere.sdk.utils.UrlQueryBuilder;

public class CartFetchByCustomerId extends FetchImpl {
    private final String customerId;

    private CartFetchByCustomerId(final String customerId) {
        super(CartsEndpoint.ENDPOINT, "");
        this.customerId = customerId;
    }

    @Override
    protected UrlQueryBuilder additionalQueryParameters() {
        return super.additionalQueryParameters().add("customerId", customerId);
    }

    public static CartFetchByCustomerId of(final Identifiable customer) {
        return of(customer.getId());
    }

    public static CartFetchByCustomerId of(final String customerId) {
        return new CartFetchByCustomerId(customerId);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy