Class SyncInfoBuilder

java.lang.Object
com.commercetools.importapi.models.orders.SyncInfoBuilder
All Implemented Interfaces:
Builder<SyncInfo>

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

     SyncInfo syncInfo = SyncInfo.builder()
             .channel(channelBuilder -> channelBuilder)
             .syncedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .build()
 
  • Constructor Details

    • SyncInfoBuilder

      public SyncInfoBuilder()
  • Method Details

    • channel

      Maps to SyncInfo.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Parameters:
      builder - function to build the channel value
      Returns:
      Builder
    • withChannel

      Maps to SyncInfo.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

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

      public SyncInfoBuilder channel(ChannelKeyReference channel)

      Maps to SyncInfo.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Parameters:
      channel - value to be set
      Returns:
      Builder
    • externalId

      public SyncInfoBuilder externalId(@Nullable String externalId)

      Maps to SyncInfo.externalId

      Parameters:
      externalId - value to be set
      Returns:
      Builder
    • syncedAt

      public SyncInfoBuilder syncedAt(ZonedDateTime syncedAt)

      Maps to SyncInfo.syncedAt

      Parameters:
      syncedAt - value to be set
      Returns:
      Builder
    • getChannel

      public ChannelKeyReference getChannel()

      Maps to SyncInfo.channel. If the referenced Channel does not exist, the state of the ImportOperation will be set to unresolved until the referenced Channel is created.

      Returns:
      channel
    • getExternalId

      @Nullable public String getExternalId()

      Maps to SyncInfo.externalId

      Returns:
      externalId
    • getSyncedAt

      public ZonedDateTime getSyncedAt()

      Maps to SyncInfo.syncedAt

      Returns:
      syncedAt
    • build

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

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

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

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