Class PromoCode


  • public final class PromoCode
    extends java.lang.Object
    • Constructor Detail

      • PromoCode

        public PromoCode​(java.lang.String code,
                         java.util.Map<java.lang.String,​java.lang.String> properties,
                         int maxClaimCount,
                         long startDate,
                         User creator,
                         long endDate,
                         int claimCount,
                         boolean isEnabled,
                         boolean isClaimable)
    • Method Detail

      • getCode

        public java.lang.String getCode()
        Returns:
        Promo code.
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Returns:
        Map of properties attached to the promo code.
      • getMaxClaimCount

        public int getMaxClaimCount()
        Returns:
        Maximum number of claims. If `0` then no limits.
      • getStartDate

        public long getStartDate()
        Returns:
        Date when Promo Code becomes active.
      • getEndDate

        public long getEndDate()
        Returns:
        Date when Promo Code is not active anymore. Zero if Promo Code is available forever until manually disabled on the Dashboard.
      • getClaimCount

        public int getClaimCount()
        Returns:
        Current number of claims.
      • isEnabled

        public boolean isEnabled()
        Returns:
        Is enabled on the Dashboard.
      • isClaimable

        public boolean isClaimable()
        Returns:
        True only if Promo Code is enabled and active in the current time.
      • getCreator

        public User getCreator()
        Returns:
        Information about creator of this promo code. Could be application.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object