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

io.sphere.sdk.projects.queries.ProjectGet Maven / Gradle / Ivy

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

import io.sphere.sdk.client.HttpRequestIntent;
import io.sphere.sdk.client.SphereRequest;
import io.sphere.sdk.client.SphereRequestBase;
import io.sphere.sdk.http.HttpResponse;
import io.sphere.sdk.projects.Project;
import io.sphere.sdk.json.JsonUtils;

import java.util.function.Function;

import static io.sphere.sdk.http.HttpMethod.GET;

public class ProjectGet extends SphereRequestBase implements SphereRequest {
    private ProjectGet() {
    }

    @Override
    public Function resultMapper() {
        return httpResponse -> JsonUtils.readObject(Project.typeReference(), httpResponse.getResponseBody().get());
    }

    @Override
    public HttpRequestIntent httpRequestIntent() {
        return HttpRequestIntent.of(GET, "");
    }

    public static SphereRequest of() {
        return new ProjectGet();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy