Class GraphQLRequestBuilder
java.lang.Object
com.commercetools.api.models.graph_ql.GraphQLRequestBuilder
- All Implemented Interfaces:
Builder<GraphQLRequest>
GraphQLRequestBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
GraphQLRequest graphQLRequest = GraphQLRequest.builder()
.query("{query}")
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds GraphQLRequest with checking for non-null required valuesbuilds GraphQLRequest without checking for non-null required valuesvalue of operationName}getQuery()
value of query}value of variables}static GraphQLRequestBuilder
of()
factory method for an instance of GraphQLRequestBuilderstatic GraphQLRequestBuilder
of
(GraphQLRequest template) create builder for GraphQLRequest instanceoperationName
(String operationName) set the value to the operationNameset the value to the queryvariables
(GraphQLVariablesMap variables) set the value to the variablesset the value to the variables using the builder functionset the value to the variables using the builder function
-
Constructor Details
-
GraphQLRequestBuilder
public GraphQLRequestBuilder()
-
-
Method Details
-
query
set the value to the query- Parameters:
query
- value to be set- Returns:
- Builder
-
operationName
set the value to the operationName- Parameters:
operationName
- value to be set- Returns:
- Builder
-
variables
public GraphQLRequestBuilder variables(Function<GraphQLVariablesMapBuilder, GraphQLVariablesMapBuilder> builder) set the value to the variables using the builder function- Parameters:
builder
- function to build the variables value- Returns:
- Builder
-
withVariables
public GraphQLRequestBuilder withVariables(Function<GraphQLVariablesMapBuilder, GraphQLVariablesMap> builder) set the value to the variables using the builder function- Parameters:
builder
- function to build the variables value- Returns:
- Builder
-
variables
set the value to the variables- Parameters:
variables
- value to be set- Returns:
- Builder
-
getQuery
value of query}- Returns:
- query
-
getOperationName
value of operationName}- Returns:
- operationName
-
getVariables
value of variables}- Returns:
- variables
-
build
builds GraphQLRequest with checking for non-null required values- Specified by:
build
in interfaceBuilder<GraphQLRequest>
- Returns:
- GraphQLRequest
-
buildUnchecked
builds GraphQLRequest without checking for non-null required values- Returns:
- GraphQLRequest
-
of
factory method for an instance of GraphQLRequestBuilder- Returns:
- builder
-
of
create builder for GraphQLRequest instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-