Search in sources :

Example 1 with PhasePriceJson

use of org.killbill.billing.jaxrs.json.PhasePriceJson in project killbill by killbill.

the class SubscriptionResourceHelpers method buildPlanPhasePriceOverrides.

public static List<PlanPhasePriceOverride> buildPlanPhasePriceOverrides(final Iterable<PhasePriceJson> priceOverrides, final Currency currency, final PlanPhaseSpecifier planPhaseSpecifier) {
    final List<PlanPhasePriceOverride> overrides = new LinkedList<PlanPhasePriceOverride>();
    if (priceOverrides != null) {
        for (final PhasePriceJson input : priceOverrides) {
            Preconditions.checkNotNull(input);
            final List<UsagePriceOverride> usagePrices = new LinkedList<UsagePriceOverride>();
            if (input.getUsagePrices() != null) {
                buildUsagePrices(currency, input, usagePrices);
            }
            overrides.add(buildPlanPhasePriceOverride(planPhaseSpecifier, currency, input, usagePrices));
        }
    }
    return overrides;
}
Also used : UsagePriceOverride(org.killbill.billing.catalog.api.UsagePriceOverride) LinkedList(java.util.LinkedList) PhasePriceJson(org.killbill.billing.jaxrs.json.PhasePriceJson) PlanPhasePriceOverride(org.killbill.billing.catalog.api.PlanPhasePriceOverride)

Aggregations

LinkedList (java.util.LinkedList)1 PlanPhasePriceOverride (org.killbill.billing.catalog.api.PlanPhasePriceOverride)1 UsagePriceOverride (org.killbill.billing.catalog.api.UsagePriceOverride)1 PhasePriceJson (org.killbill.billing.jaxrs.json.PhasePriceJson)1