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; }
public PlanAlignmentCreate getPlanCreateAlignment(final PlanSpecifier specifier, final StandaloneCatalog catalog) throws CatalogApiException { return Case.getResult(createAlignmentCase, specifier, catalog); }
public T getResult(final PlanSpecifier planPhase, final StandaloneCatalog c) throws CatalogApiException { if (satisfiesCase(planPhase, c)) { return getResult(); } return null; }
private DefaultPriceList findPriceList(final PlanSpecifier specifier, final StandaloneCatalog catalog) throws CatalogApiException { DefaultPriceList result = Case.getResult(priceListCase, specifier, catalog); if (result == null) { result = catalog.findCurrentPriceList(specifier.getPriceListName()); } return result; }
Result.LALA); final Result r1 = Case.getResult(new CaseResult[]{cr0, cr1, cr2, cr3}, new PlanSpecifier(product.getName(), product.getCategory(), BillingPeriod.MONTHLY, priceList.getName()), cat); Assert.assertEquals(r1, Result.FOO); final Result r2 = Case.getResult(new CaseResult[]{cr0, cr1, cr2}, new PlanSpecifier(product.getName(), product.getCategory(), BillingPeriod.ANNUAL, priceList.getName()), cat); Assert.assertEquals(r2, Result.DIPSY);