Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class ReferralReward
- Object
- ReferralReward
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.Methods
public String getEntitlementId() | The entitlement this reward grants, or null when it is a currency reward. |
public String getCurrencyCode() | The code of the virtual currency this reward adds to, or null when it is an entitlement reward. |
public boolean isCurrency() | Whether this reward is an amount of a virtual currency rather than an entitlement. |
public long getAmount() | The amount of currency granted; 0 for an entitlement reward. |
public long getExpiresDate() | When the reward expires, in milliseconds since the epoch, or 0 when it does not expire. |
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. |
public String toString() | Returns a string representation of the object. |
Inherited methods
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()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())