Class GeneralErrorBuilder

java.lang.Object
com.commercetools.api.models.error.GeneralErrorBuilder
All Implemented Interfaces:
Builder<GeneralError>

public class GeneralErrorBuilder extends Object implements Builder<GeneralError>
GeneralErrorBuilder
Example to create an instance using the builder pattern

     GeneralError generalError = GeneralError.builder()
             .message("{message}")
             .build()
 
  • Constructor Details

    • GeneralErrorBuilder

      public GeneralErrorBuilder()
  • Method Details

    • message

      public GeneralErrorBuilder message(String message)

      Description about any known details of the problem, for example, "Write operations are temporarily unavailable".

      Parameters:
      message - value to be set
      Returns:
      Builder
    • values

      public GeneralErrorBuilder values(Map<String,Object> values)

      Error-specific additional fields.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public GeneralErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • getMessage

      public String getMessage()

      Description about any known details of the problem, for example, "Write operations are temporarily unavailable".

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • build

      public GeneralError build()
      builds GeneralError with checking for non-null required values
      Specified by:
      build in interface Builder<GeneralError>
      Returns:
      GeneralError
    • buildUnchecked

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

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

      public static GeneralErrorBuilder of(GeneralError template)
      create builder for GeneralError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder