Class DiscountCodeNonApplicableErrorBuilder

java.lang.Object
com.commercetools.api.models.error.DiscountCodeNonApplicableErrorBuilder
All Implemented Interfaces:
Builder<DiscountCodeNonApplicableError>

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

     DiscountCodeNonApplicableError discountCodeNonApplicableError = DiscountCodeNonApplicableError.builder()
             .message("{message}")
             .build()
 
  • Constructor Details

    • DiscountCodeNonApplicableErrorBuilder

      public DiscountCodeNonApplicableErrorBuilder()
  • Method Details

    • message

      "The discountCode $discountCodeId cannot be applied to the cart."

      Parameters:
      message - value to be set
      Returns:
      Builder
    • values

      Error-specific additional fields.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public DiscountCodeNonApplicableErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • discountCode

      public DiscountCodeNonApplicableErrorBuilder discountCode(@Nullable String discountCode)

      Discount Code passed to the Cart.

      Parameters:
      discountCode - value to be set
      Returns:
      Builder
    • reason

      public DiscountCodeNonApplicableErrorBuilder reason(@Nullable String reason)

      "DoesNotExist" or "TimeRangeNonApplicable"

      Parameters:
      reason - value to be set
      Returns:
      Builder
    • discountCodeId

      public DiscountCodeNonApplicableErrorBuilder discountCodeId(@Nullable String discountCodeId)

      Unique identifier of the Discount Code.

      Parameters:
      discountCodeId - value to be set
      Returns:
      Builder
    • validFrom

      public DiscountCodeNonApplicableErrorBuilder validFrom(@Nullable ZonedDateTime validFrom)

      Date and time (UTC) from which the Discount Code is valid.

      Parameters:
      validFrom - value to be set
      Returns:
      Builder
    • validUntil

      public DiscountCodeNonApplicableErrorBuilder validUntil(@Nullable ZonedDateTime validUntil)

      Date and time (UTC) until which the Discount Code is valid.

      Parameters:
      validUntil - value to be set
      Returns:
      Builder
    • validityCheckTime

      public DiscountCodeNonApplicableErrorBuilder validityCheckTime(@Nullable ZonedDateTime validityCheckTime)

      Date and time (UTC) the Discount Code validity check was last performed.

      Parameters:
      validityCheckTime - value to be set
      Returns:
      Builder
    • getMessage

      public String getMessage()

      "The discountCode $discountCodeId cannot be applied to the cart."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getDiscountCode

      @Nullable public String getDiscountCode()

      Discount Code passed to the Cart.

      Returns:
      discountCode
    • getReason

      @Nullable public String getReason()

      "DoesNotExist" or "TimeRangeNonApplicable"

      Returns:
      reason
    • getDiscountCodeId

      @Nullable public String getDiscountCodeId()

      Unique identifier of the Discount Code.

      Returns:
      discountCodeId
    • getValidFrom

      @Nullable public ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Discount Code is valid.

      Returns:
      validFrom
    • getValidUntil

      @Nullable public ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Discount Code is valid.

      Returns:
      validUntil
    • getValidityCheckTime

      @Nullable public ZonedDateTime getValidityCheckTime()

      Date and time (UTC) the Discount Code validity check was last performed.

      Returns:
      validityCheckTime
    • build

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

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

      factory method for an instance of DiscountCodeNonApplicableErrorBuilder
      Returns:
      builder
    • of

      create builder for DiscountCodeNonApplicableError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder