Class GraphQLErrorBuilder
java.lang.Object
com.commercetools.api.models.graph_ql.GraphQLErrorBuilder
- All Implemented Interfaces:
Builder<GraphQLError>
GraphQLErrorBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
GraphQLError graphQLError = GraphQLError.builder()
.message("{message}")
.plusLocations(locationsBuilder -> locationsBuilder)
.extensions(extensionsBuilder -> extensionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd the value to the locations using the builder functionbuild()
builds GraphQLError with checking for non-null required valuesbuilds GraphQLError without checking for non-null required valuesextensions
(GraphQLErrorObject extensions) Represents a single error.extensions
(Function<GraphQLErrorObjectBuilder, Builder<? extends GraphQLErrorObject>> builder) Represents a single error.Represents a single error.value of locations}value of message}getPath()
value of path}locations
(GraphQLErrorLocation... locations) set values to the locationslocations
(List<GraphQLErrorLocation> locations) set value to the locationsset the value to the messagestatic GraphQLErrorBuilder
of()
factory method for an instance of GraphQLErrorBuilderstatic GraphQLErrorBuilder
of
(GraphQLError template) create builder for GraphQLError instanceset values to the pathset value to the pathplusLocations
(GraphQLErrorLocation... locations) add values to the locationsadd the value to the locations using the builder functionadd values to the pathset the value to the locations using the builder functionset the value to the locations using the builder function
-
Constructor Details
-
GraphQLErrorBuilder
public GraphQLErrorBuilder()
-
-
Method Details
-
message
set the value to the message- Parameters:
message
- value to be set- Returns:
- Builder
-
locations
set values to the locations- Parameters:
locations
- value to be set- Returns:
- Builder
-
locations
set value to the locations- Parameters:
locations
- value to be set- Returns:
- Builder
-
plusLocations
add values to the locations- Parameters:
locations
- value to be set- Returns:
- Builder
-
plusLocations
public GraphQLErrorBuilder plusLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocationBuilder> builder) add the value to the locations using the builder function- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
withLocations
public GraphQLErrorBuilder withLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocationBuilder> builder) set the value to the locations using the builder function- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
addLocations
public GraphQLErrorBuilder addLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocation> builder) add the value to the locations using the builder function- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
setLocations
public GraphQLErrorBuilder setLocations(Function<GraphQLErrorLocationBuilder, GraphQLErrorLocation> builder) set the value to the locations using the builder function- Parameters:
builder
- function to build the locations value- Returns:
- Builder
-
path
set values to the path- Parameters:
path
- value to be set- Returns:
- Builder
-
path
set value to the path- Parameters:
path
- value to be set- Returns:
- Builder
-
plusPath
add values to the path- Parameters:
path
- value to be set- Returns:
- Builder
-
extensions
Represents a single error.
- Parameters:
extensions
- value to be set- Returns:
- Builder
-
extensions
public GraphQLErrorBuilder extensions(Function<GraphQLErrorObjectBuilder, Builder<? extends GraphQLErrorObject>> builder) Represents a single error.
- Parameters:
builder
- function to build the extensions value- Returns:
- Builder
-
getMessage
value of message}- Returns:
- message
-
getLocations
value of locations}- Returns:
- locations
-
getPath
value of path}- Returns:
- path
-
getExtensions
Represents a single error.
- Returns:
- extensions
-
build
builds GraphQLError with checking for non-null required values- Specified by:
build
in interfaceBuilder<GraphQLError>
- Returns:
- GraphQLError
-
buildUnchecked
builds GraphQLError without checking for non-null required values- Returns:
- GraphQLError
-
of
factory method for an instance of GraphQLErrorBuilder- Returns:
- builder
-
of
create builder for GraphQLError instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-