Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class EntitlementInfo

  1. Object
  2. EntitlementInfo

One entitlement of a customer, as the Codename One Commerce service reported it. An entitlement is what the application checks (“pro”), and is independent of the store and of the product that granted it.

Instances are immutable. They are created by CustomerInfo from the service’s answer and never by the application.

Methods

public String getId()The entitlement id, the name the application checks.
public boolean isActive()Whether the service considers the entitlement held.
public long getExpiresDate()When the entitlement ends, in milliseconds since the epoch, or 0 when it has no end (a lifetime purchase) or the service did not say.
public String getProductId()The store product that granted the entitlement, or null.
public String getStore()The store the grant came from, as the service names it, or null.
public String getPeriodType()The kind of period the customer is in (a trial, an introductory period, the normal one), as the service names it, or null.
public String getOwnershipType()Whether the customer bought the product or received it through family sharing, as the service names it, or null.
public String getBillingStage()Where the subscription is in its billing life (in a grace period, in billing retry and so on), as the service names it, or null.
public boolean isWillRenew()Whether the subscription behind the entitlement is set to renew.
public String getProvenance()How the grant came to be (a purchase, a promotional grant, a transfer), as the service names it, or null.
public Map<String, Object> toMap()This entitlement as the JSON object it was built from, for storage.
public String toString()Returns a string representation of the object.

Inherited methods

Method details

getId

public String getId()
The entitlement id, the name the application checks.

isActive

public boolean isActive()
Whether the service considers the entitlement held. This is the service’s decision, made with its own clock; it is not recomputed on the device from getExpiresDate().

getExpiresDate

public long getExpiresDate()
When the entitlement ends, in milliseconds since the epoch, or 0 when it has no end (a lifetime purchase) or the service did not say.

getProductId

public String getProductId()
The store product that granted the entitlement, or null.

getStore

public String getStore()
The store the grant came from, as the service names it, or null.

getPeriodType

public String getPeriodType()
The kind of period the customer is in (a trial, an introductory period, the normal one), as the service names it, or null.

getOwnershipType

public String getOwnershipType()
Whether the customer bought the product or received it through family sharing, as the service names it, or null.

getBillingStage

public String getBillingStage()
Where the subscription is in its billing life (in a grace period, in billing retry and so on), as the service names it, or null.

isWillRenew

public boolean isWillRenew()
Whether the subscription behind the entitlement is set to renew.

getProvenance

public String getProvenance()
How the grant came to be (a purchase, a promotional grant, a transfer), as the service names it, or null.

toMap

public Map<String, Object> toMap()
This entitlement as the JSON object it was built from, for storage.

Returns

a new map, which the caller may change

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())