/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package org.quantlib;

public class MakeOIS {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected MakeOIS(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(MakeOIS obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        QuantLibJNI.delete_MakeOIS(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double fixedRate, Period fwdStart) {
    this(QuantLibJNI.new_MakeOIS__SWIG_0(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex, fixedRate, Period.getCPtr(fwdStart), fwdStart), true);
  }

  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double fixedRate) {
    this(QuantLibJNI.new_MakeOIS__SWIG_1(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex, fixedRate), true);
  }

  public MakeOIS(Period swapTenor, OvernightIndex overnightIndex) {
    this(QuantLibJNI.new_MakeOIS__SWIG_2(Period.getCPtr(swapTenor), swapTenor, OvernightIndex.getCPtr(overnightIndex), overnightIndex), true);
  }

  public OvernightIndexedSwap makeOIS() {
    long cPtr = QuantLibJNI.MakeOIS_makeOIS(swigCPtr, this);
    return (cPtr == 0) ? null : new OvernightIndexedSwap(cPtr, true);
  }

  public MakeOIS receiveFixed(boolean flag) {
    return new MakeOIS(QuantLibJNI.MakeOIS_receiveFixed__SWIG_0(swigCPtr, this, flag), false);
  }

  public MakeOIS receiveFixed() {
    return new MakeOIS(QuantLibJNI.MakeOIS_receiveFixed__SWIG_1(swigCPtr, this), false);
  }

  public MakeOIS withType(OvernightIndexedSwap.Type type) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withType(swigCPtr, this, type.swigValue()), false);
  }

  public MakeOIS withNominal(double n) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withNominal(swigCPtr, this, n), false);
  }

  public MakeOIS withSettlementDays(long settlementDays) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withSettlementDays(swigCPtr, this, settlementDays), false);
  }

  public MakeOIS withEffectiveDate(Date arg0) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withEffectiveDate(swigCPtr, this, Date.getCPtr(arg0), arg0), false);
  }

  public MakeOIS withTerminationDate(Date arg0) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withTerminationDate(swigCPtr, this, Date.getCPtr(arg0), arg0), false);
  }

  public MakeOIS withRule(DateGeneration.Rule r) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withRule(swigCPtr, this, r.swigValue()), false);
  }

  public MakeOIS withPaymentFrequency(Frequency f) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentFrequency(swigCPtr, this, f.swigValue()), false);
  }

  public MakeOIS withPaymentAdjustment(BusinessDayConvention convention) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentAdjustment(swigCPtr, this, convention.swigValue()), false);
  }

  public MakeOIS withPaymentLag(long lag) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentLag(swigCPtr, this, lag), false);
  }

  public MakeOIS withPaymentCalendar(Calendar cal) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withPaymentCalendar(swigCPtr, this, Calendar.getCPtr(cal), cal), false);
  }

  public MakeOIS withEndOfMonth(boolean flag) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withEndOfMonth__SWIG_0(swigCPtr, this, flag), false);
  }

  public MakeOIS withEndOfMonth() {
    return new MakeOIS(QuantLibJNI.MakeOIS_withEndOfMonth__SWIG_1(swigCPtr, this), false);
  }

  public MakeOIS withFixedLegDayCount(DayCounter dc) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withFixedLegDayCount(swigCPtr, this, DayCounter.getCPtr(dc), dc), false);
  }

  public MakeOIS withOvernightLegSpread(double sp) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withOvernightLegSpread(swigCPtr, this, sp), false);
  }

  public MakeOIS withDiscountingTermStructure(YieldTermStructureHandle discountingTermStructure) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withDiscountingTermStructure(swigCPtr, this, YieldTermStructureHandle.getCPtr(discountingTermStructure), discountingTermStructure), false);
  }

  public MakeOIS withTelescopicValueDates(boolean telescopicValueDates) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withTelescopicValueDates(swigCPtr, this, telescopicValueDates), false);
  }

  public MakeOIS withPricingEngine(PricingEngine engine) {
    return new MakeOIS(QuantLibJNI.MakeOIS_withPricingEngine(swigCPtr, this, PricingEngine.getCPtr(engine), engine), false);
  }

}
