Class MaxResourceLimitExceededErrorBuilder

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

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

     MaxResourceLimitExceededError maxResourceLimitExceededError = MaxResourceLimitExceededError.builder()
             .message("{message}")
             .exceededResource(ReferenceTypeId.APPROVAL_FLOW)
             .build()
 
  • Constructor Details

    • MaxResourceLimitExceededErrorBuilder

      public MaxResourceLimitExceededErrorBuilder()
  • Method Details

    • message

      public MaxResourceLimitExceededErrorBuilder message(String message)

      "You have exceeded the limit of $limit resources of type $resourceTypeId."

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

      Error-specific additional fields.

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

      public MaxResourceLimitExceededErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public MaxResourceLimitExceededErrorBuilder exceededResource(ReferenceTypeId exceededResource)

      Resource type that reached its maximum limit of configured elements (for example, 100 Zones per Project).

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

      public String getMessage()

      "You have exceeded the limit of $limit resources of type $resourceTypeId."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getExceededResource

      public ReferenceTypeId getExceededResource()

      Resource type that reached its maximum limit of configured elements (for example, 100 Zones per Project).

      Returns:
      exceededResource
    • build

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

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

      factory method for an instance of MaxResourceLimitExceededErrorBuilder
      Returns:
      builder
    • of

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