Class EntitlementInfo
java.lang.Object
com.codename1.payment.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.
-
Method Summary
Modifier and TypeMethodDescriptionWhere the subscription is in its billing life (in a grace period, in billing retry and so on), as the service names it, or null.longWhen the entitlement ends, in milliseconds since the epoch, or 0 when it has no end (a lifetime purchase) or the service did not say.getId()The entitlement id, the name the application checks.Whether the customer bought the product or received it through family sharing, as the service names it, or null.The kind of period the customer is in (a trial, an introductory period, the normal one), as the service names it, or null.The store product that granted the entitlement, or null.How the grant came to be (a purchase, a promotional grant, a transfer), as the service names it, or null.getStore()The store the grant came from, as the service names it, or null.booleanisActive()Whether the service considers the entitlement held.booleanWhether the subscription behind the entitlement is set to renew.toMap()This entitlement as the JSON object it was built from, for storage.toString()Returns a string representation of the object.
-
Method Details
-
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 fromgetExpiresDate(). -
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
The store product that granted the entitlement, or null. -
getStore
The store the grant came from, as the service names it, or null. -
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
Whether the customer bought the product or received it through family sharing, as the service names it, or null. -
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
How the grant came to be (a purchase, a promotional grant, a transfer), as the service names it, or null. -
toMap
-
toString
Description copied from class:ObjectReturns 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())
-