Class PriceNormalizer
java.lang.Object
org.strassburger.subscriptionmanager.util.PriceNormalizer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleconvertPrice(double price, BillingPeriod fromPeriod, BillingPeriod toPeriod) Convert a price from one billing period to another.static doublenormalizePrice(double price, String billingPeriod) Normalize the price of a subscription to a monthly price.static doublenormalizePrice(double price, BillingPeriod billingPeriod) Normalize the price of a subscription to a monthly price.
-
Constructor Details
-
PriceNormalizer
public PriceNormalizer()
-
-
Method Details
-
normalizePrice
Normalize the price of a subscription to a monthly price.- Parameters:
price- the price of the subscriptionbillingPeriod- the billing period of the subscription- Returns:
- the normalized price
-
normalizePrice
Normalize the price of a subscription to a monthly price.- Parameters:
price- the price of the subscriptionbillingPeriod- the billing period of the subscription- Returns:
- the normalized price
-
convertPrice
Convert a price from one billing period to another.- Parameters:
price- the price to convertfromPeriod- the billing period of the pricetoPeriod- the billing period to convert to- Returns:
- the converted price
-