Interface ProductDiscount

All Superinterfaces:
BaseResource, DomainResource<ProductDiscount>, Identifiable<ProductDiscount>, ProductDiscountMixin, Referencable<ProductDiscount>, ResourceIdentifiable<ProductDiscount>, Versioned<ProductDiscount>, WithKey
All Known Implementing Classes:
ProductDiscountImpl

ProductDiscount
Example to create an instance using the builder pattern

     ProductDiscount productDiscount = ProductDiscount.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .name(nameBuilder -> nameBuilder)
             .value(valueBuilder -> valueBuilder)
             .predicate("{predicate}")
             .sortOrder("{sortOrder}")
             .isActive(true)
             .plusReferences(referencesBuilder -> referencesBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the ProductDiscount.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<ProductDiscount>
      Specified by:
      getId in interface Identifiable<ProductDiscount>
      Specified by:
      getId in interface Versioned<ProductDiscount>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the ProductDiscount.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<ProductDiscount>
      Specified by:
      getVersion in interface Versioned<ProductDiscount>
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

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

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

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

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      Present on resources created after 1 February 2019 except for events not tracked.

      Returns:
      createdBy
    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the ProductDiscount.

      Returns:
      name
    • getKey

      String getKey()

      User-defined unique identifier of the ProductDiscount.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Description of the ProductDiscount.

      Returns:
      description
    • getValue

      @NotNull @Valid @NotNull @Valid ProductDiscountValue getValue()

      Type of Discount and its corresponding value.

      Returns:
      value
    • getPredicate

      @NotNull @NotNull String getPredicate()

      Valid ProductDiscount predicate.

      Returns:
      predicate
    • getSortOrder

      @NotNull @NotNull String getSortOrder()

      Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.

      Returns:
      sortOrder
    • getIsActive

      @NotNull @NotNull Boolean getIsActive()

      If true the Product Discount is applied to Products matching the predicate.

      Returns:
      isActive
    • getReferences

      @NotNull @Valid @NotNull @Valid List<Reference> getReferences()

      References of all the resources that are addressed in the predicate.

      Returns:
      references
    • getValidFrom

      ZonedDateTime getValidFrom()

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Returns:
      validUntil
    • setId

      void setId(String id)

      Unique identifier of the ProductDiscount.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the ProductDiscount.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

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

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

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

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      Present on resources created after 1 February 2019 except for events not tracked.

      Parameters:
      createdBy - value to be set
    • setName

      void setName(LocalizedString name)

      Name of the ProductDiscount.

      Parameters:
      name - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the ProductDiscount.

      Parameters:
      key - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the ProductDiscount.

      Parameters:
      description - value to be set
    • setValue

      void setValue(ProductDiscountValue value)

      Type of Discount and its corresponding value.

      Parameters:
      value - value to be set
    • setPredicate

      void setPredicate(String predicate)

      Valid ProductDiscount predicate.

      Parameters:
      predicate - value to be set
    • setSortOrder

      void setSortOrder(String sortOrder)

      Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.

      Parameters:
      sortOrder - value to be set
    • setIsActive

      void setIsActive(Boolean isActive)

      If true the Product Discount is applied to Products matching the predicate.

      Parameters:
      isActive - value to be set
    • setReferences

      void setReferences(Reference... references)

      References of all the resources that are addressed in the predicate.

      Parameters:
      references - values to be set
    • setReferences

      void setReferences(List<Reference> references)

      References of all the resources that are addressed in the predicate.

      Parameters:
      references - values to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.

      Parameters:
      validUntil - value to be set
    • of

      static ProductDiscount of()
      factory method
      Returns:
      instance of ProductDiscount
    • of

      static ProductDiscount of(ProductDiscount template)
      factory method to create a shallow copy ProductDiscount
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ProductDiscount deepCopy(@Nullable ProductDiscount template)
      factory method to create a deep copy of ProductDiscount
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductDiscountBuilder builder()
      builder factory method for ProductDiscount
      Returns:
      builder
    • builder

      static ProductDiscountBuilder builder(ProductDiscount template)
      create builder for ProductDiscount instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductDiscount

      default <T> T withProductDiscount(Function<ProductDiscount,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • referenceTypeId

      static ReferenceTypeId referenceTypeId()
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ProductDiscount> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference