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

io.sphere.sdk.customers.queries.CustomerByTokenFetch Maven / Gradle / Ivy

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

import io.sphere.sdk.customers.Customer;
import io.sphere.sdk.customers.CustomerToken;
import io.sphere.sdk.queries.FetchImpl;
import io.sphere.sdk.http.UrlQueryBuilder;

import static io.sphere.sdk.customers.queries.CustomersEndpoint.ENDPOINT;

public class CustomerByTokenFetch extends FetchImpl {
    private final String token;

    private CustomerByTokenFetch(final String token) {
        super(ENDPOINT, "");
        this.token = token;
    }

    public static CustomerByTokenFetch of(final String token) {
        return new CustomerByTokenFetch(token);
    }

    public static CustomerByTokenFetch of(final CustomerToken token) {
        return of(token.getValue());
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy