class CapFloorCMS extends CouponFloating implements CapFloor {

  @SuppressWarnings("deprecation")
  public static CapFloorCMS from(final CouponCMS coupon, final double strike, final boolean isCap) {
    try {
      return new CapFloorCMS(coupon.getCurrency(), coupon.getPaymentTime(), coupon.getUnderlyingSwap().getFixedLeg().getNthPayment(0).getFundingCurveName(),
          coupon.getPaymentYearFraction(), coupon.getNotional(), coupon.getFixingTime(), coupon.getUnderlyingSwap(), coupon.getSettlementTime(), strike, isCap);
    } catch (final IllegalStateException e) {
      return new CapFloorCMS(coupon.getCurrency(), coupon.getPaymentTime(), coupon.getPaymentYearFraction(), coupon.getNotional(),
          coupon.getFixingTime(), coupon.getUnderlyingSwap(), coupon.getSettlementTime(), strike, isCap);
    }
  }

  @Deprecated public  CapFloorCMS(final Currency currency, final double paymentTime, final String fundingCurveName, final double paymentYearFraction, final double notional,
      final double fixingTime, final SwapFixedCoupon<? extends Payment> underlyingSwap, final double settlementTime,
      final double strike, final boolean isCap);
  public  CapFloorCMS(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional,
      final double fixingTime, final SwapFixedCoupon<? extends Payment> underlyingSwap, final double settlementTime,
      final double strike, final boolean isCap);

}