Class ConcurrentModificationErrorBuilder

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

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

     ConcurrentModificationError concurrentModificationError = ConcurrentModificationError.builder()
             .message("{message}")
             .build()
 
  • Constructor Details

    • ConcurrentModificationErrorBuilder

      public ConcurrentModificationErrorBuilder()
  • Method Details

    • message

      public ConcurrentModificationErrorBuilder message(String message)

      "Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."

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

      Error-specific additional fields.

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

      public ConcurrentModificationErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

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

      public ConcurrentModificationErrorBuilder currentVersion(@Nullable Long currentVersion)

      Current version of the resource.

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

      public String getMessage()

      "Object $resourceId has a different version than expected. Expected: $expectedVersion - Actual: $currentVersion."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getCurrentVersion

      @Nullable public Long getCurrentVersion()

      Current version of the resource.

      Returns:
      currentVersion
    • build

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

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

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

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