Interface Coupon

  • All Superinterfaces:
    PrettyPrintable

    public interface Coupon
    extends PrettyPrintable
    The interface that represents a coupon and contains all related data.
    Author:
    soknight
    • Method Detail

      • getId

        int getId()
        Get the unique ID of this coupon.
        Returns:
        The coupon ID.
      • getShopId

        int getShopId()
        Get an ID of the owning shop.
        Returns:
        The shop ID.
      • getName

        @NotNull
        @NotNull String getName()
        Get the name of this coupon.
        Returns:
        The coupon name.
      • getCode

        @NotNull
        @NotNull String getCode()
        Get the code of this coupon.
        This code must be specified in the promo code field to use this coupon.
        Returns:
        The coupon code.
      • getDiscountPercent

        double getDiscountPercent()
        Get the discount percent of this coupon.
        It's a number from 1 to 100.
        Returns:
        The coupon discount percent.
      • getMaxUsages

        @NotNull
        @NotNull OptionalInt getMaxUsages()
        Get the optional-wrapped amount of max usages for this coupon.
        If the usages amount limit wasn't actually specified, this method will return an empty Optional.
        Returns:
        The optional-wrapped coupon max usages limit.
      • getProducts

        @NotNull
        @NotNull ProductsList getProducts()
        Get the list of related products for this coupon.
        Only for these products this coupon may be applied.
        Returns:
        The coupon compatibly products list.
      • getExpiresAt

        @NotNull
        @NotNull Optional<LocalDateTime> getExpiresAt()
        Get the optional-wrapped expiration date of this coupon.
        If the expiration date wasn't actually specified, this method will return an empty Optional.
        Returns:
        The optional-wrapped coupon expiration date.
      • getCreatedAt

        @NotNull
        @NotNull LocalDateTime getCreatedAt()
        Get the creation date for this coupon.
        Returns:
        The coupon creation date.
      • getUpdatedAt

        @NotNull
        @NotNull LocalDateTime getUpdatedAt()
        Get the date of last coupon update.
        Returns:
        The last coupon update date.