Class Offering

java.lang.Object
com.codename1.payment.Offering

public final class Offering extends Object

A set of packages the application offers a customer together, and optionally the paywall that presents them. Which offering a customer sees is decided by the Codename One Commerce service, so it can be changed, or tested against another, without a new build of the application.

Instances are immutable.

  • Method Details

    • getId

      public String getId()
      The id of the offering.
    • getDescription

      public String getDescription()
      The description given to the offering in the console, or null.
    • getMetadata

      public Map<String,Object> getMetadata()

      The free form metadata attached to the offering in the console.

      Returns

      a new map, which the caller may change

    • getPackages

      public List<CommercePackage> getPackages()

      The packages of the offering, in the order the service listed them.

      Returns

      a new list, which the caller may change

    • getPaywall

      public Map getPaywall()

      The paywall document designed for this offering, as parsed JSON.

      Returns

      a new map, which the caller may change, or null when the offering has no paywall

    • getPackage

      public CommercePackage getPackage(String packageId)

      The package with the given id.

      Returns

      the package, or null when the offering has none by that id

    • getMonthly

      public CommercePackage getMonthly()
      The first package billed monthly, or null.
    • getAnnual

      public CommercePackage getAnnual()
      The first package billed annually, or null.
    • getLifetime

      public CommercePackage getLifetime()
      The first lifetime package, or null.
    • getWeekly

      public CommercePackage getWeekly()
      The first package billed weekly, 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