class ConstantContinuousSingleBarrierKnockoutFunction extends SingleBarrierKnockoutFunction implements ImmutableBean, Serializable {

  public static ConstantContinuousSingleBarrierKnockoutFunction of(
      double strike,
      double timeToExpiry,
      PutCall putCall,
      int numberOfSteps,
      BarrierType barrierType,
      double barrierLevel,
      DoubleArray rebate) {

    ArgChecker.isTrue(numberOfSteps > 0, "the number of steps should be positive");
    ArgChecker.isTrue(numberOfSteps + 1 == rebate.size(), "the size of rebate should be numberOfSteps + 1");
    double sign = putCall.isCall() ? 1d : -1d;
    return new ConstantContinuousSingleBarrierKnockoutFunction(
        strike, timeToExpiry, sign, numberOfSteps, barrierType, barrierLevel, rebate);
  }

  private  ConstantContinuousSingleBarrierKnockoutFunction(
      double strike,
      double timeToExpiry,
      double sign,
      int numberOfSteps,
      BarrierType barrierType,
      double barrierLevel,
      DoubleArray rebate);

}