Class ChannelBuilder

java.lang.Object
com.commercetools.api.models.channel.ChannelBuilder
All Implemented Interfaces:
Builder<Channel>

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

     Channel channel = Channel.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .key("{key}")
             .plusRoles(rolesBuilder -> rolesBuilder)
             .build()
 
  • Constructor Details

    • ChannelBuilder

      public ChannelBuilder()
  • Method Details

    • id

      public ChannelBuilder id(String id)

      Unique identifier of the Channel.

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

      public ChannelBuilder version(Long version)

      Current version of the Channel.

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

      public ChannelBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Channel was initially created.

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

      public ChannelBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Channel was last updated.

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

      IDs and references that last modified the Channel.

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

      public ChannelBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the Channel.

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

      public ChannelBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Channel.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the Channel.

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

      public ChannelBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the Channel.

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

      public ChannelBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the Channel.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • key

      public ChannelBuilder key(String key)

      User-defined unique identifier of the Channel.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • roles

      public ChannelBuilder roles(ChannelRoleEnum... roles)

      Roles of the Channel.

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

      public ChannelBuilder roles(List<ChannelRoleEnum> roles)

      Roles of the Channel.

      Parameters:
      roles - value to be set
      Returns:
      Builder
    • plusRoles

      public ChannelBuilder plusRoles(ChannelRoleEnum... roles)

      Roles of the Channel.

      Parameters:
      roles - value to be set
      Returns:
      Builder
    • name

      Name of the Channel.

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

      Name of the Channel.

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

      Name of the Channel.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • description

      Description of the Channel.

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

      Description of the Channel.

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

      public ChannelBuilder description(@Nullable LocalizedString description)

      Description of the Channel.

      Parameters:
      description - value to be set
      Returns:
      Builder
    • address

      Address where the Channel is located (for example, if the Channel is a physical store).

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

      public ChannelBuilder withAddress(Function<AddressBuilder,Address> builder)

      Address where the Channel is located (for example, if the Channel is a physical store).

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

      public ChannelBuilder address(@Nullable Address address)

      Address where the Channel is located (for example, if the Channel is a physical store).

      Parameters:
      address - value to be set
      Returns:
      Builder
    • reviewRatingStatistics

      Statistics about the review ratings taken into account for the Channel.

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

      public ChannelBuilder withReviewRatingStatistics(Function<ReviewRatingStatisticsBuilder,ReviewRatingStatistics> builder)

      Statistics about the review ratings taken into account for the Channel.

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

      public ChannelBuilder reviewRatingStatistics(@Nullable ReviewRatingStatistics reviewRatingStatistics)

      Statistics about the review ratings taken into account for the Channel.

      Parameters:
      reviewRatingStatistics - value to be set
      Returns:
      Builder
    • custom

      Custom Fields defined for the Channel.

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

      Custom Fields defined for the Channel.

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

      public ChannelBuilder custom(@Nullable CustomFields custom)

      Custom Fields defined for the Channel.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • geoLocation

      public ChannelBuilder geoLocation(@Nullable GeoJson geoLocation)

      GeoJSON geometry object encoding the geo location of the Channel.

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

      public ChannelBuilder geoLocation(Function<GeoJsonBuilder,Builder<? extends GeoJson>> builder)

      GeoJSON geometry object encoding the geo location of the Channel.

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

      public String getId()

      Unique identifier of the Channel.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Channel.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Channel was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Channel was last updated.

      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Channel.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the Channel.

      Returns:
      createdBy
    • getKey

      public String getKey()

      User-defined unique identifier of the Channel.

      Returns:
      key
    • getRoles

      public List<ChannelRoleEnum> getRoles()

      Roles of the Channel.

      Returns:
      roles
    • getName

      @Nullable public LocalizedString getName()

      Name of the Channel.

      Returns:
      name
    • getDescription

      @Nullable public LocalizedString getDescription()

      Description of the Channel.

      Returns:
      description
    • getAddress

      @Nullable public Address getAddress()

      Address where the Channel is located (for example, if the Channel is a physical store).

      Returns:
      address
    • getReviewRatingStatistics

      @Nullable public ReviewRatingStatistics getReviewRatingStatistics()

      Statistics about the review ratings taken into account for the Channel.

      Returns:
      reviewRatingStatistics
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields defined for the Channel.

      Returns:
      custom
    • getGeoLocation

      @Nullable public GeoJson getGeoLocation()

      GeoJSON geometry object encoding the geo location of the Channel.

      Returns:
      geoLocation
    • build

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

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

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

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