Class ImportOperationBuilder

java.lang.Object
com.commercetools.importapi.models.importoperations.ImportOperationBuilder
All Implemented Interfaces:
Builder<ImportOperation>

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

     ImportOperation importOperation = ImportOperation.builder()
             .version(1)
             .importContainerKey("{importContainerKey}")
             .resourceKey("{resourceKey}")
             .id("{id}")
             .state(ProcessingState.PROCESSING)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .expiresAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .build()
 
  • Constructor Details

    • ImportOperationBuilder

      public ImportOperationBuilder()
  • Method Details

    • version

      public ImportOperationBuilder version(Long version)

      The version of the ImportOperation.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • importContainerKey

      public ImportOperationBuilder importContainerKey(String importContainerKey)

      The key of the importContainer.

      Parameters:
      importContainerKey - value to be set
      Returns:
      Builder
    • resourceKey

      public ImportOperationBuilder resourceKey(String resourceKey)

      The key of the resource.

      Parameters:
      resourceKey - value to be set
      Returns:
      Builder
    • id

      The ID of the ImportOperation.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • state

      The import status of the resource. Set to rejected or validationFailed if the import of the resource was not successful.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • resourceVersion

      public ImportOperationBuilder resourceVersion(@Nullable Long resourceVersion)

      The version of the imported resource when the import was successful.

      Parameters:
      resourceVersion - value to be set
      Returns:
      Builder
    • errors

      public ImportOperationBuilder errors(@Nullable ErrorObject... errors)

      Contains an error if the import of the resource was not successful. See Errors.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • errors

      Contains an error if the import of the resource was not successful. See Errors.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public ImportOperationBuilder plusErrors(@Nullable ErrorObject... errors)

      Contains an error if the import of the resource was not successful. See Errors.

      Parameters:
      errors - value to be set
      Returns:
      Builder
    • plusErrors

      public ImportOperationBuilder plusErrors(Function<ErrorObjectBuilder,Builder<? extends ErrorObject>> builder)

      Contains an error if the import of the resource was not successful. See Errors.

      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • withErrors

      public ImportOperationBuilder withErrors(Function<ErrorObjectBuilder,Builder<? extends ErrorObject>> builder)

      Contains an error if the import of the resource was not successful. See Errors.

      Parameters:
      builder - function to build the errors value
      Returns:
      Builder
    • unresolvedReferences

      public ImportOperationBuilder unresolvedReferences(@Nullable UnresolvedReferences... unresolvedReferences)

      In case of unresolved status this array will show the unresolved references

      Parameters:
      unresolvedReferences - value to be set
      Returns:
      Builder
    • unresolvedReferences

      public ImportOperationBuilder unresolvedReferences(@Nullable List<UnresolvedReferences> unresolvedReferences)

      In case of unresolved status this array will show the unresolved references

      Parameters:
      unresolvedReferences - value to be set
      Returns:
      Builder
    • plusUnresolvedReferences

      public ImportOperationBuilder plusUnresolvedReferences(@Nullable UnresolvedReferences... unresolvedReferences)

      In case of unresolved status this array will show the unresolved references

      Parameters:
      unresolvedReferences - value to be set
      Returns:
      Builder
    • plusUnresolvedReferences

      In case of unresolved status this array will show the unresolved references

      Parameters:
      builder - function to build the unresolvedReferences value
      Returns:
      Builder
    • withUnresolvedReferences

      In case of unresolved status this array will show the unresolved references

      Parameters:
      builder - function to build the unresolvedReferences value
      Returns:
      Builder
    • addUnresolvedReferences

      In case of unresolved status this array will show the unresolved references

      Parameters:
      builder - function to build the unresolvedReferences value
      Returns:
      Builder
    • setUnresolvedReferences

      In case of unresolved status this array will show the unresolved references

      Parameters:
      builder - function to build the unresolvedReferences value
      Returns:
      Builder
    • createdAt

      public ImportOperationBuilder createdAt(ZonedDateTime createdAt)

      The time when the ImportOperation was created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public ImportOperationBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      The last time When the ImportOperation was modified.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • expiresAt

      public ImportOperationBuilder expiresAt(ZonedDateTime expiresAt)

      The expiration time of the ImportOperation.

      Parameters:
      expiresAt - value to be set
      Returns:
      Builder
    • getVersion

      public Long getVersion()

      The version of the ImportOperation.

      Returns:
      version
    • getImportContainerKey

      public String getImportContainerKey()

      The key of the importContainer.

      Returns:
      importContainerKey
    • getResourceKey

      public String getResourceKey()

      The key of the resource.

      Returns:
      resourceKey
    • getId

      public String getId()

      The ID of the ImportOperation.

      Returns:
      id
    • getState

      public ProcessingState getState()

      The import status of the resource. Set to rejected or validationFailed if the import of the resource was not successful.

      Returns:
      state
    • getResourceVersion

      @Nullable public Long getResourceVersion()

      The version of the imported resource when the import was successful.

      Returns:
      resourceVersion
    • getErrors

      @Nullable public List<ErrorObject> getErrors()

      Contains an error if the import of the resource was not successful. See Errors.

      Returns:
      errors
    • getUnresolvedReferences

      @Nullable public List<UnresolvedReferences> getUnresolvedReferences()

      In case of unresolved status this array will show the unresolved references

      Returns:
      unresolvedReferences
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      The time when the ImportOperation was created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      The last time When the ImportOperation was modified.

      Returns:
      lastModifiedAt
    • getExpiresAt

      public ZonedDateTime getExpiresAt()

      The expiration time of the ImportOperation.

      Returns:
      expiresAt
    • build

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

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

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

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