Class GraphQLDataResponseBuilder

java.lang.Object
com.commercetools.graphql.api.GraphQLDataResponseBuilder
All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<GraphQLDataResponse>

public class GraphQLDataResponseBuilder extends Object implements io.vrap.rmf.base.client.Builder<GraphQLDataResponse>
GraphQLDataResponseBuilder
Example to create an instance using the builder pattern

     GraphQLDataResponse graphQLResponse = GraphQLDataResponseBuilder.builder()
             .build()
 
  • Constructor Details

    • GraphQLDataResponseBuilder

      public GraphQLDataResponseBuilder()
  • Method Details

    • data

      set the value to the data
      Parameters:
      data - value to be set
      Returns:
      Builder
    • errors

      public GraphQLDataResponseBuilder errors(@Nullable com.commercetools.api.models.graph_ql.GraphQLError... errors)
      set values to the errors
      Parameters:
      errors - value to be set
      Returns:
      Builder
    • errors

      public GraphQLDataResponseBuilder errors(@Nullable List<com.commercetools.api.models.graph_ql.GraphQLError> errors)
      set value to the errors
      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public GraphQLDataResponseBuilder plusErrors(@Nullable com.commercetools.api.models.graph_ql.GraphQLError... errors)
      add values to the errors
      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public GraphQLDataResponseBuilder plusErrors(Function<com.commercetools.api.models.graph_ql.GraphQLErrorBuilder,com.commercetools.api.models.graph_ql.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<com.commercetools.api.models.graph_ql.GraphQLErrorBuilder,com.commercetools.api.models.graph_ql.GraphQLErrorBuilder> builder)
      set the value to the errors using the builder function
      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • addErrors

      public GraphQLDataResponseBuilder addErrors(Function<com.commercetools.api.models.graph_ql.GraphQLErrorBuilder,com.commercetools.api.models.graph_ql.GraphQLError> builder)
      add the value to the errors using the builder function
      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • setErrors

      public GraphQLDataResponseBuilder setErrors(Function<com.commercetools.api.models.graph_ql.GraphQLErrorBuilder,com.commercetools.api.models.graph_ql.GraphQLError> builder)
      set the value to the errors using the builder function
      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • getData

      @Nullable public GraphQLData getData()
      value of data}
      Returns:
      data
    • getErrors

      @Nullable public List<com.commercetools.api.models.graph_ql.GraphQLError> getErrors()
      value of errors}
      Returns:
      errors
    • build

      public GraphQLDataResponse build()
      builds GraphQLResponse with checking for non-null required values
      Specified by:
      build in interface io.vrap.rmf.base.client.Builder<GraphQLDataResponse>
      Returns:
      GraphQLResponse
    • buildUnchecked

      public GraphQLDataResponse buildUnchecked()
      builds GraphQLResponse without checking for non-null required values
      Returns:
      GraphQLResponse
    • of

      public static GraphQLDataResponseBuilder of()
      factory method for an instance of GraphQLResponseBuilder
      Returns:
      builder
    • of

      public static GraphQLDataResponseBuilder of(GraphQLDataResponse template)
      create builder for GraphQLResponse instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder