Class EntitlementInfo

java.lang.Object
com.codename1.payment.EntitlementInfo

public final class EntitlementInfo extends Object

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 Type
    Method
    Description
    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.
    long
    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.
    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.
    The store the grant came from, as the service names it, or null.
    boolean
    Whether the service considers the entitlement held.
    boolean
    Whether the subscription behind the entitlement is set to renew.
    This entitlement as the JSON object it was built from, for storage.
    Returns a string representation of the object.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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()
      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