Class GraphQlBaseRequestImpl<T extends GraphQlBaseResult<? extends GraphQlBaseResource>>
- java.lang.Object
-
- com.commercetools.sync.commons.helpers.GraphQlBaseRequestImpl<T>
-
- All Implemented Interfaces:
GraphQlBaseRequest<T>
,io.sphere.sdk.client.SphereRequest<T>
- Direct Known Subclasses:
FetchCustomObjectsGraphQlRequest
,ResourceIdsGraphQlRequest
,ResourceKeyIdGraphQlRequest
public abstract class GraphQlBaseRequestImpl<T extends GraphQlBaseResult<? extends GraphQlBaseResource>> extends java.lang.Object implements GraphQlBaseRequest<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected long
limit
protected java.lang.String
queryPredicate
-
Constructor Summary
Constructors Constructor Description GraphQlBaseRequestImpl()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.String
buildQueryString()
This method builds a string matching the required format needed in the CTP graphql API.T
deserializeWithResourceName(io.sphere.sdk.http.HttpResponse httpResponse, java.lang.String resourceName, java.lang.Class<T> clazz)
Deserialize the body ofhttpResponse
.io.sphere.sdk.client.HttpRequestIntent
httpRequestIntent()
GraphQlBaseRequest<T>
withLimit(long limit)
This method adds a limit to the request.GraphQlBaseRequest<T>
withPredicate(java.lang.String predicate)
This method adds a predicate string to the request.
-
-
-
Method Detail
-
withPredicate
@Nonnull public GraphQlBaseRequest<T> withPredicate(java.lang.String predicate)
This method adds a predicate string to the request.- Specified by:
withPredicate
in interfaceGraphQlBaseRequest<T extends GraphQlBaseResult<? extends GraphQlBaseResource>>
- Parameters:
predicate
- - a string representing a query predicate.- Returns:
- - an instance of this class.
-
withLimit
@Nonnull public GraphQlBaseRequest<T> withLimit(long limit)
This method adds a limit to the request.- Specified by:
withLimit
in interfaceGraphQlBaseRequest<T extends GraphQlBaseResult<? extends GraphQlBaseResource>>
- Parameters:
limit
- - a number representing the query limit parameter- Returns:
- - an instance of this class
-
httpRequestIntent
public io.sphere.sdk.client.HttpRequestIntent httpRequestIntent()
- Specified by:
httpRequestIntent
in interfaceio.sphere.sdk.client.SphereRequest<T extends GraphQlBaseResult<? extends GraphQlBaseResource>>
-
deserializeWithResourceName
@Nullable public T deserializeWithResourceName(@Nonnull io.sphere.sdk.http.HttpResponse httpResponse, @Nonnull java.lang.String resourceName, @Nonnull java.lang.Class<T> clazz)
Deserialize the body ofhttpResponse
.- Parameters:
httpResponse
- httpResponse of the request.resourceName
- resource type in the query (i.e "customers", "products", "customObjects")clazz
- the type of the class to deserialize.- Returns:
- the deserialized body of the graphql request.
-
buildQueryString
protected abstract java.lang.String buildQueryString()
This method builds a string matching the required format needed in the CTP graphql API.- Returns:
- a string representing a graphql query
-
-