@Override public Collection<Plan> findPlans(final Product product, final BillingPeriod period) { final List<Plan> result = new ArrayList<Plan>(plans.size()); for (final Plan cur : getPlans()) { if (cur.getProduct().equals(product) && (cur.getRecurringBillingPeriod() != null && cur.getRecurringBillingPeriod().equals(period))) { result.add(cur); } } return result; }
if (!BillingPeriod.NO_BILLING_PERIOD.equals(getRecurringBillingPeriod()) && recurringBillingMode == null) { errors.add(new ValidationError(String.format("Invalid recurring billingMode for plan '%s'", name), DefaultPlan.class, ""));
(fromProduct == null || fromProduct.equals(inFromProduct)) && (fromProductCategory == null || fromProductCategory.equals(inFromProductCategory)) && (fromBillingPeriod == null || fromBillingPeriod.equals(inFromBillingPeriod)) && (this.toProduct == null || this.toProduct.equals(inToProduct)) && (this.toProductCategory == null || this.toProductCategory.equals(inToProductCategory)) && (this.toBillingPeriod == null || this.toBillingPeriod.equals(inToBillingPeriod)) && (fromPriceList == null || fromPriceList.equals(inFromPriceList)) && (toPriceList == null || toPriceList.equals(inToPriceList))
protected boolean satisfiesCase(final PlanSpecifier planPhase, final StaticCatalog c) throws CatalogApiException { final Product product; final BillingPeriod billingPeriod; final ProductCategory productCategory; final PriceList priceList; if (planPhase.getPlanName() != null) { final Plan plan = c.findCurrentPlan(planPhase.getPlanName()); product = plan.getProduct(); billingPeriod = plan.getRecurringBillingPeriod(); productCategory = plan.getProduct().getCategory(); priceList = c.findCurrentPricelist(plan.getPriceListName()); } else { product = c.findCurrentProduct(planPhase.getProductName()); billingPeriod = planPhase.getBillingPeriod(); productCategory = product.getCategory(); priceList = getPriceList() != null ? c.findCurrentPricelist(planPhase.getPriceListName()) : null; } return (getProduct() == null || getProduct().equals(product)) && (getProductCategory() == null || getProductCategory().equals(productCategory)) && (getBillingPeriod() == null || getBillingPeriod().equals(billingPeriod)) && (getPriceList() == null || getPriceList().equals(priceList)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final PlanJson planJson = (PlanJson) o; if (name != null ? !name.equals(planJson.name) : planJson.name != null) { return false; } if (billingPeriod != null ? !billingPeriod.equals(planJson.billingPeriod) : planJson.billingPeriod != null) { return false; } if (phases != null ? !phases.equals(planJson.phases) : planJson.phases != null) { return false; } return true; }
@Override public Collection<Plan> findPlans(final Product product, final BillingPeriod period) { final List<Plan> result = new ArrayList<Plan>(plans.size()); for (final Plan cur : getPlans()) { if (cur.getProduct().equals(product) && (cur.getRecurringBillingPeriod() != null && cur.getRecurringBillingPeriod().equals(period))) { result.add(cur); } } return result; }
if (billingPeriod != null ? !billingPeriod.equals(that.billingPeriod) : that.billingPeriod != null) { return false;
return false; if (billingPeriod != null ? !billingPeriod.equals(that.billingPeriod) : that.billingPeriod != null) { return false;
if (billingPeriod != null ? !billingPeriod.equals(that.billingPeriod) : that.billingPeriod != null) { return false;
if (!BillingPeriod.NO_BILLING_PERIOD.equals(getRecurringBillingPeriod()) && recurringBillingMode == null) { errors.add(new ValidationError(String.format("Invalid recurring billingMode for plan '%s'", name), DefaultPlan.class, ""));
(fromProduct == null || fromProduct.equals(inFromProduct)) && (fromProductCategory == null || fromProductCategory.equals(inFromProductCategory)) && (fromBillingPeriod == null || fromBillingPeriod.equals(inFromBillingPeriod)) && (this.toProduct == null || this.toProduct.equals(inToProduct)) && (this.toProductCategory == null || this.toProductCategory.equals(inToProductCategory)) && (this.toBillingPeriod == null || this.toBillingPeriod.equals(inToBillingPeriod)) && (fromPriceList == null || fromPriceList.equals(inFromPriceList)) && (toPriceList == null || toPriceList.equals(inToPriceList))
protected boolean satisfiesCase(final PlanSpecifier planPhase, final StaticCatalog c) throws CatalogApiException { final Product product; final BillingPeriod billingPeriod; final ProductCategory productCategory; final PriceList priceList; if (planPhase.getPlanName() != null) { final Plan plan = c.findCurrentPlan(planPhase.getPlanName()); product = plan.getProduct(); billingPeriod = plan.getRecurringBillingPeriod(); productCategory = plan.getProduct().getCategory(); priceList = c.findCurrentPricelist(plan.getPriceListName()); } else { product = c.findCurrentProduct(planPhase.getProductName()); billingPeriod = planPhase.getBillingPeriod(); productCategory = product.getCategory(); priceList = getPriceList() != null ? c.findCurrentPricelist(planPhase.getPriceListName()) : null; } return (getProduct() == null || getProduct().equals(product)) && (getProductCategory() == null || getProductCategory().equals(productCategory)) && (getBillingPeriod() == null || getBillingPeriod().equals(billingPeriod)) && (getPriceList() == null || getPriceList().equals(priceList)); }