Class RequiredFieldErrorBuilder

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

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

     RequiredFieldError requiredFieldError = RequiredFieldError.builder()
             .message("{message}")
             .field("{field}")
             .build()
 
  • Constructor Details

    • RequiredFieldErrorBuilder

      public RequiredFieldErrorBuilder()
  • Method Details

    • message

      public RequiredFieldErrorBuilder message(String message)

      "A value is required for field $field."

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

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

      Error-specific additional fields.

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

      public RequiredFieldErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public RequiredFieldErrorBuilder field(String field)

      Name of the field missing the value.

      Parameters:
      field - value to be set
      Returns:
      Builder
    • getMessage

      public String getMessage()

      "A value is required for field $field."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getField

      public String getField()

      Name of the field missing the value.

      Returns:
      field
    • build

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

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

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

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