Class StandardScheduleBuilder

java.lang.Object
com.commercetools.api.models.recurrence_policy.StandardScheduleBuilder
All Implemented Interfaces:
Builder<StandardSchedule>

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

     StandardSchedule standardSchedule = StandardSchedule.builder()
             .value(0.3)
             .intervalUnit(IntervalUnit.DAYS)
             .build()
 
  • Constructor Details

    • StandardScheduleBuilder

      public StandardScheduleBuilder()
  • Method Details

    • value

      public StandardScheduleBuilder value(Long value)

      Number of intervals between orders.

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

      public StandardScheduleBuilder intervalUnit(IntervalUnit intervalUnit)

      Interval of this schedule.

      Parameters:
      intervalUnit - value to be set
      Returns:
      Builder
    • getValue

      public Long getValue()

      Number of intervals between orders.

      Returns:
      value
    • getIntervalUnit

      public IntervalUnit getIntervalUnit()

      Interval of this schedule.

      Returns:
      intervalUnit
    • build

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

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

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

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