Class PriceNormalizer

java.lang.Object
org.strassburger.subscriptionmanager.util.PriceNormalizer

public class PriceNormalizer extends Object
  • Constructor Details

    • PriceNormalizer

      public PriceNormalizer()
  • Method Details

    • normalizePrice

      public static double normalizePrice(double price, BillingPeriod billingPeriod)
      Normalize the price of a subscription to a monthly price.
      Parameters:
      price - the price of the subscription
      billingPeriod - the billing period of the subscription
      Returns:
      the normalized price
    • normalizePrice

      public static double normalizePrice(double price, String billingPeriod)
      Normalize the price of a subscription to a monthly price.
      Parameters:
      price - the price of the subscription
      billingPeriod - the billing period of the subscription
      Returns:
      the normalized price
    • convertPrice

      public static double convertPrice(double price, BillingPeriod fromPeriod, BillingPeriod toPeriod)
      Convert a price from one billing period to another.
      Parameters:
      price - the price to convert
      fromPeriod - the billing period of the price
      toPeriod - the billing period to convert to
      Returns:
      the converted price