Class ZoneDraftBuilder

java.lang.Object
com.commercetools.api.models.zone.ZoneDraftBuilder
All Implemented Interfaces:
Builder<ZoneDraft>

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

     ZoneDraft zoneDraft = ZoneDraft.builder()
             .name("{name}")
             .build()
 
  • Constructor Details

    • ZoneDraftBuilder

      public ZoneDraftBuilder()
  • Method Details

    • key

      public ZoneDraftBuilder key(@Nullable String key)

      User-defined unique identifier for the Zone.

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

      public ZoneDraftBuilder name(String name)

      Name of the Zone.

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

      public ZoneDraftBuilder description(@Nullable String description)

      Description of the Zone.

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

      public ZoneDraftBuilder locations(@Nullable Location... locations)

      List of locations that belong to the Zone.

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

      public ZoneDraftBuilder locations(@Nullable List<Location> locations)

      List of locations that belong to the Zone.

      Parameters:
      locations - value to be set
      Returns:
      Builder
    • plusLocations

      public ZoneDraftBuilder plusLocations(@Nullable Location... locations)

      List of locations that belong to the Zone.

      Parameters:
      locations - value to be set
      Returns:
      Builder
    • plusLocations

      public ZoneDraftBuilder plusLocations(Function<LocationBuilder,LocationBuilder> builder)

      List of locations that belong to the Zone.

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

      public ZoneDraftBuilder withLocations(Function<LocationBuilder,LocationBuilder> builder)

      List of locations that belong to the Zone.

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

      public ZoneDraftBuilder addLocations(Function<LocationBuilder,Location> builder)

      List of locations that belong to the Zone.

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

      public ZoneDraftBuilder setLocations(Function<LocationBuilder,Location> builder)

      List of locations that belong to the Zone.

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

      @Nullable public String getKey()

      User-defined unique identifier for the Zone.

      Returns:
      key
    • getName

      public String getName()

      Name of the Zone.

      Returns:
      name
    • getDescription

      @Nullable public String getDescription()

      Description of the Zone.

      Returns:
      description
    • getLocations

      @Nullable public List<Location> getLocations()

      List of locations that belong to the Zone.

      Returns:
      locations
    • build

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

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

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

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