类 AbstractTimeBasedCalculator<C extends TimeBasedChargeable>

java.lang.Object
org.coodex.billing.timebased.AbstractTimeBasedCalculator<C>
所有已实现的接口:
Calculator<C>, SelectableService<C>

public abstract class AbstractTimeBasedCalculator<C extends TimeBasedChargeable> extends Object implements Calculator<C>
  • 构造器详细资料

    • AbstractTimeBasedCalculator

      public AbstractTimeBasedCalculator()
  • 方法详细资料

    • getTimeUnit

      protected abstract TimeUnit getTimeUnit()
    • calc

      public Bill<C> calc(C chargeable)
      指定者:
      calc 在接口中 Calculator<C extends TimeBasedChargeable>
    • copyChargeable

      protected abstract C copyChargeable(C chargeable, List<Revision> revisions)
      !!! 自行实现,默认实现不靠谱
      参数:
      chargeable - chargeable
      revisions - revisions
      返回:
      根据参数复制一个新的消费对象,用于多规则场景
    • adjustBill

      protected Bill<C> adjustBill(Bill<C> bill, List<? extends Adjustment<C>> adjustments)
      参数:
      bill - 需要调整的账单
      adjustments - 调整项目
      返回:
      调整后账单