Class GraphQLResponseBuilder
java.lang.Object
com.commercetools.api.models.graph_ql.GraphQLResponseBuilder
- All Implemented Interfaces:
Builder<GraphQLResponse>
GraphQLResponseBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
GraphQLResponse graphQLResponse = GraphQLResponse.builder()
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddErrors
(Function<GraphQLErrorBuilder, GraphQLError> builder) Errors that the GraphQL query returns.build()
builds GraphQLResponse with checking for non-null required valuesbuilds GraphQLResponse without checking for non-null required valuesJSON object that contains the results of a GraphQL query.errors
(GraphQLError... errors) Errors that the GraphQL query returns.errors
(List<GraphQLError> errors) Errors that the GraphQL query returns.getData()
JSON object that contains the results of a GraphQL query.Errors that the GraphQL query returns.static GraphQLResponseBuilder
of()
factory method for an instance of GraphQLResponseBuilderstatic GraphQLResponseBuilder
of
(GraphQLResponse template) create builder for GraphQLResponse instanceplusErrors
(GraphQLError... errors) Errors that the GraphQL query returns.Errors that the GraphQL query returns.setErrors
(Function<GraphQLErrorBuilder, GraphQLError> builder) Errors that the GraphQL query returns.Errors that the GraphQL query returns.
-
Constructor Details
-
GraphQLResponseBuilder
public GraphQLResponseBuilder()
-
-
Method Details
-
data
JSON object that contains the results of a GraphQL query.
- Parameters:
data
- value to be set- Returns:
- Builder
-
errors
Errors that the GraphQL query returns.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
errors
Errors that the GraphQL query returns.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
Errors that the GraphQL query returns.
- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
Errors that the GraphQL query returns.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
withErrors
Errors that the GraphQL query returns.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
addErrors
Errors that the GraphQL query returns.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
setErrors
Errors that the GraphQL query returns.
- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
getData
JSON object that contains the results of a GraphQL query.
- Returns:
- data
-
getErrors
Errors that the GraphQL query returns.
- Returns:
- errors
-
build
builds GraphQLResponse with checking for non-null required values- Specified by:
build
in interfaceBuilder<GraphQLResponse>
- Returns:
- GraphQLResponse
-
buildUnchecked
builds GraphQLResponse without checking for non-null required values- Returns:
- GraphQLResponse
-
of
factory method for an instance of GraphQLResponseBuilder- Returns:
- builder
-
of
create builder for GraphQLResponse instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-