Class JpaSubscriptionPeriod

java.lang.Object
com.broadleafcommerce.subscription.provider.jpa.domain.JpaSubscriptionPeriod
All Implemented Interfaces:
Serializable

public class JpaSubscriptionPeriod extends Object implements Serializable
Persistent counter-part to an SubscriptionPeriod for use with a JPA datastore.
Author:
Dima Myroniuk (dmyroniuk)
See Also:
  • Constructor Details

    • JpaSubscriptionPeriod

      public JpaSubscriptionPeriod()
  • Method Details

    • convert

      public Object convert(org.modelmapper.spi.MappingContext<?,?> context)
    • getPeriod

      public Integer getPeriod()
      The period number
    • getBillDate

      public Date getBillDate()
      The bill date of the period
    • getPeriodStartDate

      public Date getPeriodStartDate()
      The start date of the period
    • getPeriodEndDate

      public Date getPeriodEndDate()
      The end date of the period
    • isFreeTrial

      public boolean isFreeTrial()
      Whether this period represents a free trial period.

      When this is true, the periodStartDate and periodEndDate represents the start and end dates of the free trial, and the period number will be 0.

    • getShortenedPeriodReason

      public String getShortenedPeriodReason()
      Describes the reason that the period was shortened.
      See Also:
    • getNumberOfDaysInShortenedPeriod

      public Long getNumberOfDaysInShortenedPeriod()
      If a period is shortened (typically by the Subscription.getEndOfTermDate() occurring before the end of the period), then this value will describe the number of days in the shortened period. Otherwise, this value will be null. If the period is shortened, this value should be used in combination with getNumberOfDaysInFullPeriod() to prorate subscription pricing for the subscription period. numberOfDaysInShortenedPeriod divided by getNumberOfDaysInFullPeriod() gives the proration rate.
    • getNumberOfDaysInFullPeriod

      public Long getNumberOfDaysInFullPeriod()
      If a period is shortened (typically by the Subscription.getEndOfTermDate() occurring before the end of the period), then this value will describe the number of days in the full period - i.e. the length of the period if it had not been shortened. Otherwise, this value will be null. If the period is shortened, this value should be used in combination with getNumberOfDaysInShortenedPeriod() to prorate subscription pricing for the subscription period. numberOfDaysInShortenedPeriod divided by getNumberOfDaysInFullPeriod() gives the proration rate.
    • getAttributes

      public Map<String,Object> getAttributes()
      Any additional attributes used to describe the period
    • setPeriod

      public void setPeriod(Integer period)
      The period number
    • setBillDate

      public void setBillDate(Date billDate)
      The bill date of the period
    • setPeriodStartDate

      public void setPeriodStartDate(Date periodStartDate)
      The start date of the period
    • setPeriodEndDate

      public void setPeriodEndDate(Date periodEndDate)
      The end date of the period
    • setFreeTrial

      public void setFreeTrial(boolean isFreeTrial)
      Whether this period represents a free trial period.

      When this is true, the periodStartDate and periodEndDate represents the start and end dates of the free trial, and the period number will be 0.

    • setShortenedPeriodReason

      public void setShortenedPeriodReason(String shortenedPeriodReason)
      Describes the reason that the period was shortened.
      See Also:
    • setNumberOfDaysInShortenedPeriod

      public void setNumberOfDaysInShortenedPeriod(Long numberOfDaysInShortenedPeriod)
      If a period is shortened (typically by the Subscription.getEndOfTermDate() occurring before the end of the period), then this value will describe the number of days in the shortened period. Otherwise, this value will be null. If the period is shortened, this value should be used in combination with getNumberOfDaysInFullPeriod() to prorate subscription pricing for the subscription period. numberOfDaysInShortenedPeriod divided by getNumberOfDaysInFullPeriod() gives the proration rate.
    • setNumberOfDaysInFullPeriod

      public void setNumberOfDaysInFullPeriod(Long numberOfDaysInFullPeriod)
      If a period is shortened (typically by the Subscription.getEndOfTermDate() occurring before the end of the period), then this value will describe the number of days in the full period - i.e. the length of the period if it had not been shortened. Otherwise, this value will be null. If the period is shortened, this value should be used in combination with getNumberOfDaysInShortenedPeriod() to prorate subscription pricing for the subscription period. numberOfDaysInShortenedPeriod divided by getNumberOfDaysInFullPeriod() gives the proration rate.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Any additional attributes used to describe the period
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object