Package com.commercetools.graphql.api
Class GraphQLDataResponseBuilder
java.lang.Object
com.commercetools.graphql.api.GraphQLDataResponseBuilder
- All Implemented Interfaces:
Builder<GraphQLDataResponse>
GraphQLDataResponseBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
GraphQLDataResponse graphQLResponse = GraphQLDataResponseBuilder.builder()
.build()
-
Constructor Summary
Constructors -
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 valuesdata(GraphQLData data) set 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 GraphQLDataResponseBuilderof()factory method for an instance of GraphQLResponseBuilderstatic GraphQLDataResponseBuilderof(GraphQLDataResponse 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
-
GraphQLDataResponseBuilder
public GraphQLDataResponseBuilder()
-
-
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
public GraphQLDataResponseBuilder plusErrors(Function<GraphQLErrorBuilder, GraphQLErrorBuilder> builder) add the value to the errors using the builder function- Parameters:
builder- function to build the errors value- Returns:
- Builder
-
withErrors
public GraphQLDataResponseBuilder withErrors(Function<GraphQLErrorBuilder, GraphQLErrorBuilder> builder) 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:
buildin interfaceBuilder<GraphQLDataResponse>- 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
-