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) add the value to the errors using the builder functionbuild()
builds GraphQLResponse with checking for non-null required valuesbuilds GraphQLResponse without checking for non-null required valuesset the value to the dataerrors
(GraphQLError... errors) set values to the errorserrors
(List<GraphQLError> errors) set value to the errorsgetData()
value of data}value of errors}static GraphQLResponseBuilder
of()
factory method for an instance of GraphQLResponseBuilderstatic GraphQLResponseBuilder
of
(GraphQLResponse template) create builder for GraphQLResponse instanceplusErrors
(GraphQLError... errors) add values to the errorsadd the value to the errors using the builder functionsetErrors
(Function<GraphQLErrorBuilder, GraphQLError> builder) set the value to the errors using the builder functionset the value to the errors using the builder function
-
Constructor Details
-
GraphQLResponseBuilder
public GraphQLResponseBuilder()
-
-
Method Details
-
data
set the value to the data- Parameters:
data
- value to be set- Returns:
- Builder
-
errors
set values to the errors- Parameters:
errors
- value to be set- Returns:
- Builder
-
errors
set value to the errors- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
add values to the errors- Parameters:
errors
- value to be set- Returns:
- Builder
-
plusErrors
add the value to the errors using the builder function- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
withErrors
set the value to the errors using the builder function- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
addErrors
add the value to the errors using the builder function- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
setErrors
set the value to the errors using the builder function- Parameters:
builder
- function to build the errors value- Returns:
- Builder
-
getData
value of data}- Returns:
- data
-
getErrors
value of errors}- 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
-