Class ReferralReward

java.lang.Object
com.codename1.payment.ReferralReward

public final class ReferralReward extends Object
A reward the service granted this customer for a referral: either an entitlement or an amount of a virtual currency. Rewards are configured in the console and listed by CustomerInfo.getReferralRewards(). Immutable.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    The amount of currency granted; 0 for an entitlement reward.
    The code of the virtual currency this reward adds to, or null when it is an entitlement reward.
    The entitlement this reward grants, or null when it is a currency reward.
    long
    When the reward expires, in milliseconds since the epoch, or 0 when it does not expire.
    Why the reward was granted, as the service names it -- for example that a user this customer invited made a purchase -- or null.
    boolean
    Whether this reward is an amount of a virtual currency rather than an entitlement.
    Returns a string representation of the object.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getEntitlementId

      public String getEntitlementId()

      The entitlement this reward grants, or null when it is a currency reward.

      Returns

      the entitlement id or null

    • getCurrencyCode

      public String getCurrencyCode()

      The code of the virtual currency this reward adds to, or null when it is an entitlement reward.

      Returns

      the currency code or null

    • isCurrency

      public boolean isCurrency()

      Whether this reward is an amount of a virtual currency rather than an entitlement.

      Returns

      true for a currency reward

    • getAmount

      public long getAmount()

      The amount of currency granted; 0 for an entitlement reward.

      Returns

      the amount

    • getExpiresDate

      public long getExpiresDate()

      When the reward expires, in milliseconds since the epoch, or 0 when it does not expire.

      Returns

      the expiry time or 0

    • getReason

      public String getReason()

      Why the reward was granted, as the service names it -- for example that a user this customer invited made a purchase -- or null.

      Returns

      the reason or null

    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object