Class ReferenceExistsErrorBuilder

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

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

     ReferenceExistsError referenceExistsError = ReferenceExistsError.builder()
             .message("{message}")
             .build()
 
  • Constructor Details

    • ReferenceExistsErrorBuilder

      public ReferenceExistsErrorBuilder()
  • Method Details

    • message

      public ReferenceExistsErrorBuilder message(String message)

      "Can not delete a $resource while it is referenced by at least one $referencedBy."

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

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

      Error-specific additional fields.

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

      public ReferenceExistsErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public ReferenceExistsErrorBuilder referencedBy(@Nullable ReferenceTypeId referencedBy)

      Type of referenced resource.

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

      public String getMessage()

      "Can not delete a $resource while it is referenced by at least one $referencedBy."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getReferencedBy

      @Nullable public ReferenceTypeId getReferencedBy()

      Type of referenced resource.

      Returns:
      referencedBy
    • build

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

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

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

      create builder for ReferenceExistsError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder