public static <K> K getResult(final CasePhase<K>[] cases, final PlanPhaseSpecifier planSpec, final StandaloneCatalog catalog) throws CatalogApiException { if (cases != null) { for (final CasePhase<K> cp : cases) { final K result = cp.getResult(planSpec, catalog); if (result != null) { return result; } } } return null; }
public static <K> K getResult(final Case<K>[] cases, final PlanSpecifier planSpec, final StandaloneCatalog catalog) throws CatalogApiException { if (cases != null) { for (final Case<K> c : cases) { final K result = c.getResult(planSpec, catalog); if (result != null) { return result; } } } return null; }
@Override public BillingActionPolicy planChangePolicy(final PlanPhaseSpecifier from, final PlanSpecifier to) throws CatalogApiException { return planRules.getPlanChangePolicy(from, to, this); }
public CaseChangeResult(final DefaultProduct from, final DefaultProduct to, final ProductCategory fromProductCategory, final ProductCategory toProductCategory, final BillingPeriod fromBP, final BillingPeriod toBP, final DefaultPriceList fromPriceList, final DefaultPriceList toPriceList, final PhaseType fromType, final Result result) { setFromProduct(from); setToProduct(to); setFromProductCategory(fromProductCategory); setToProductCategory(toProductCategory); setFromPriceList(fromPriceList); setToPriceList(toPriceList); setFromBillingPeriod(fromBP); setToBillingPeriod(toBP); setPhaseType(fromType); this.result = result; }
@BeforeMethod(groups = "fast") public void beforeMethod() { cat = new MockCatalog(); final DefaultPriceList priceList2 = cat.getPriceLists().getChildPriceLists()[0]; final CaseChangePlanPolicy casePolicy = new CaseChangePlanPolicy().setPolicy(BillingActionPolicy.END_OF_TERM); final CaseChangePlanAlignment caseAlignment = new CaseChangePlanAlignment().setAlignment(PlanAlignmentChange.START_OF_SUBSCRIPTION); final CasePriceList casePriceList = new CasePriceList().setToPriceList(priceList2); cat.getPlanRules(). setChangeCase(new CaseChangePlanPolicy[]{casePolicy}). setChangeAlignmentCase(new CaseChangePlanAlignment[]{caseAlignment}). setPriceListCase(new CasePriceList[]{casePriceList}); }
public CaseResult(final DefaultProduct product, final ProductCategory productCategory, final BillingPeriod billingPeriod, final DefaultPriceList priceList, final PhaseType phaseType, final Result policy) { setProduct(product); setProductCategory(productCategory); setBillingPeriod(billingPeriod); setPriceList(priceList); setPhaseType(phaseType); this.policy = policy; }
public CaseResult(final DefaultProduct product, final ProductCategory productCategory, final BillingPeriod billingPeriod, final DefaultPriceList priceList, final Result policy) { setProduct(product); setProductCategory(productCategory); setBillingPeriod(billingPeriod); setPriceList(priceList); this.policy = policy; }
public T getResult(final PlanSpecifier planPhase, final StandaloneCatalog c) throws CatalogApiException { if (satisfiesCase(planPhase, c)) { return getResult(); } return null; }
public static <K> K getResult(final CaseChange<K>[] cases, final PlanPhaseSpecifier from, final PlanSpecifier to, final StandaloneCatalog catalog) throws CatalogApiException { if (cases != null) { for (final CaseChange<K> cc : cases) { final K result = cc.getResult(from, to, catalog); if (result != null) { return result; } } } return null; }
@Override public PlanChangeResult planChange(final PlanPhaseSpecifier from, final PlanSpecifier to) throws CatalogApiException { return planRules.planChange(from, to, this); }
@Override public PlanAlignmentCreate planCreateAlignment(final PlanSpecifier specifier) throws CatalogApiException { return planRules.getPlanCreateAlignment(specifier, this); }
@Override public BillingActionPolicy planCancelPolicy(final PlanPhaseSpecifier planPhase) throws CatalogApiException { return planRules.getPlanCancelPolicy(planPhase, this); }
@Override public BillingAlignment billingAlignment(final PlanPhaseSpecifier planPhase) throws CatalogApiException { return planRules.getBillingAlignment(planPhase, this); }
@Override public PlanAlignmentChange planChangeAlignment(final PlanPhaseSpecifier from, final PlanSpecifier to) throws CatalogApiException { return planRules.getPlanChangeAlignment(from, to, this); }
public void populateRules() { setPlanRules(new PlanRules()); }
@Override public ValidationErrors validate(final StandaloneCatalog catalog, final ValidationErrors errors) { validate(catalog, errors, products); validate(catalog, errors, plans); priceLists.validate(catalog, errors); planRules.validate(catalog, errors); return errors; }
public BillingAlignment getBillingAlignment(final PlanPhaseSpecifier planPhase, final StandaloneCatalog catalog) throws CatalogApiException { return CasePhase.getResult(billingAlignmentCase, planPhase, catalog); }
public PlanAlignmentCreate getPlanCreateAlignment(final PlanSpecifier specifier, final StandaloneCatalog catalog) throws CatalogApiException { return Case.getResult(createAlignmentCase, specifier, catalog); }
public PlanAlignmentChange getPlanChangeAlignment(final PlanPhaseSpecifier from, final PlanSpecifier to, final StandaloneCatalog catalog) throws CatalogApiException { return CaseChange.getResult(changeAlignmentCase, from, to, catalog); }
public BillingActionPolicy getPlanCancelPolicy(final PlanPhaseSpecifier planPhase, final StandaloneCatalog catalog) throws CatalogApiException { return CasePhase.getResult(cancelCase, planPhase, catalog); }