Class DuplicateFieldErrorBuilder

java.lang.Object
com.commercetools.importapi.models.errors.DuplicateFieldErrorBuilder
All Implemented Interfaces:
Builder<DuplicateFieldError>

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

     DuplicateFieldError duplicateFieldError = DuplicateFieldError.builder()
             .message("{message}")
             .build()
 
  • Constructor Details

    • DuplicateFieldErrorBuilder

      public DuplicateFieldErrorBuilder()
  • Method Details

    • message

      public DuplicateFieldErrorBuilder message(String message)
      set the value to the message
      Parameters:
      message - value to be set
      Returns:
      Builder
    • field

      The name of the field.

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

      public DuplicateFieldErrorBuilder duplicateValue(@Nullable Object duplicateValue)

      The offending duplicate value.

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

      public String getMessage()
      value of message}
      Returns:
      message
    • getField

      @Nullable public String getField()

      The name of the field.

      Returns:
      field
    • getDuplicateValue

      @Nullable public Object getDuplicateValue()

      The offending duplicate value.

      Returns:
      duplicateValue
    • build

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

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

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

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