/* ----------------------------------------------------------------------------
 * 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 MakeVanillaSwap {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

  protected static long getCPtr(MakeVanillaSwap 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_MakeVanillaSwap(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

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

  public MakeVanillaSwap receiveFixed() {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_receiveFixed__SWIG_1(swigCPtr, this), false);
  }

  public MakeVanillaSwap withType(VanillaSwap.Type type) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withType(swigCPtr, this, type.swigValue()), false);
  }

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

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

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

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

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

  public MakeVanillaSwap withFixedLegTenor(Period t) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegTenor(swigCPtr, this, Period.getCPtr(t), t), false);
  }

  public MakeVanillaSwap withFixedLegCalendar(Calendar cal) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegCalendar(swigCPtr, this, Calendar.getCPtr(cal), cal), false);
  }

  public MakeVanillaSwap withFixedLegConvention(BusinessDayConvention bdc) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegConvention(swigCPtr, this, bdc.swigValue()), false);
  }

  public MakeVanillaSwap withFixedLegTerminationDateConvention(BusinessDayConvention bdc) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegTerminationDateConvention(swigCPtr, this, bdc.swigValue()), false);
  }

  public MakeVanillaSwap withFixedLegRule(DateGeneration.Rule r) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegRule(swigCPtr, this, r.swigValue()), false);
  }

  public MakeVanillaSwap withFixedLegEndOfMonth(boolean flag) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegEndOfMonth__SWIG_0(swigCPtr, this, flag), false);
  }

  public MakeVanillaSwap withFixedLegEndOfMonth() {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegEndOfMonth__SWIG_1(swigCPtr, this), false);
  }

  public MakeVanillaSwap withFixedLegFirstDate(Date d) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegFirstDate(swigCPtr, this, Date.getCPtr(d), d), false);
  }

  public MakeVanillaSwap withFixedLegNextToLastDate(Date d) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFixedLegNextToLastDate(swigCPtr, this, Date.getCPtr(d), d), false);
  }

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

  public MakeVanillaSwap withFloatingLegTenor(Period t) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegTenor(swigCPtr, this, Period.getCPtr(t), t), false);
  }

  public MakeVanillaSwap withFloatingLegCalendar(Calendar cal) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegCalendar(swigCPtr, this, Calendar.getCPtr(cal), cal), false);
  }

  public MakeVanillaSwap withFloatingLegConvention(BusinessDayConvention bdc) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegConvention(swigCPtr, this, bdc.swigValue()), false);
  }

  public MakeVanillaSwap withFloatingLegTerminationDateConvention(BusinessDayConvention bdc) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegTerminationDateConvention(swigCPtr, this, bdc.swigValue()), false);
  }

  public MakeVanillaSwap withFloatingLegRule(DateGeneration.Rule r) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegRule(swigCPtr, this, r.swigValue()), false);
  }

  public MakeVanillaSwap withFloatingLegEndOfMonth(boolean flag) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegEndOfMonth__SWIG_0(swigCPtr, this, flag), false);
  }

  public MakeVanillaSwap withFloatingLegEndOfMonth() {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegEndOfMonth__SWIG_1(swigCPtr, this), false);
  }

  public MakeVanillaSwap withFloatingLegFirstDate(Date d) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegFirstDate(swigCPtr, this, Date.getCPtr(d), d), false);
  }

  public MakeVanillaSwap withFloatingLegNextToLastDate(Date d) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegNextToLastDate(swigCPtr, this, Date.getCPtr(d), d), false);
  }

  public MakeVanillaSwap withFloatingLegDayCount(DayCounter dc) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegDayCount(swigCPtr, this, DayCounter.getCPtr(dc), dc), false);
  }

  public MakeVanillaSwap withFloatingLegSpread(double sp) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withFloatingLegSpread(swigCPtr, this, sp), false);
  }

  public MakeVanillaSwap withDiscountingTermStructure(YieldTermStructureHandle discountCurve) {
    return new MakeVanillaSwap(QuantLibJNI.MakeVanillaSwap_withDiscountingTermStructure(swigCPtr, this, YieldTermStructureHandle.getCPtr(discountCurve), discountCurve), false);
  }

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

  public MakeVanillaSwap(Period swapTenor, IborIndex index, double fixedRate, Period forwardStart) {
    this(QuantLibJNI.new_MakeVanillaSwap(Period.getCPtr(swapTenor), swapTenor, IborIndex.getCPtr(index), index, fixedRate, Period.getCPtr(forwardStart), forwardStart), true);
  }

  public VanillaSwap makeVanillaSwap() {
    long cPtr = QuantLibJNI.MakeVanillaSwap_makeVanillaSwap(swigCPtr, this);
    return (cPtr == 0) ? null : new VanillaSwap(cPtr, true);
  }

}
