Esempio n. 1
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 100346066:         // index
                    this.index_Renamed = (PriceIndex)newValue;
                    break;

                case 106898:         // lag
                    this.lag_Renamed = (Period)newValue;
                    break;

                case -1409010088:         // indexCalculationMethod
                    this.indexCalculationMethod_Renamed = (PriceIndexCalculationMethod)newValue;
                    break;

                case -159410813:         // notionalExchange
                    this.notionalExchange_Renamed = (bool?)newValue.Value;
                    break;

                case -716438393:         // paymentDateOffset
                    this.paymentDateOffset_Renamed = (DaysAdjustment)newValue;
                    break;

                case 896049114:         // accrualBusinessDayAdjustment
                    this.accrualBusinessDayAdjustment_Renamed = (BusinessDayAdjustment)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Esempio n. 2
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(InflationRateSwapLegConvention beanToCopy)
 {
     this.index_Renamed = beanToCopy.Index;
     this.lag_Renamed   = beanToCopy.Lag;
     this.indexCalculationMethod_Renamed       = beanToCopy.IndexCalculationMethod;
     this.notionalExchange_Renamed             = beanToCopy.NotionalExchange;
     this.paymentDateOffset_Renamed            = beanToCopy.paymentDateOffset;
     this.accrualBusinessDayAdjustment_Renamed = beanToCopy.accrualBusinessDayAdjustment;
 }
Esempio n. 3
0
 private InflationRateSwapLegConvention(PriceIndex index, Period lag, PriceIndexCalculationMethod indexCalculationMethod, bool notionalExchange, DaysAdjustment paymentDateOffset, BusinessDayAdjustment accrualBusinessDayAdjustment)
 {
     JodaBeanUtils.notNull(index, "index");
     JodaBeanUtils.notNull(lag, "lag");
     JodaBeanUtils.notNull(indexCalculationMethod, "indexCalculationMethod");
     this.index = index;
     this.lag   = lag;
     this.indexCalculationMethod       = indexCalculationMethod;
     this.notionalExchange             = notionalExchange;
     this.paymentDateOffset            = paymentDateOffset;
     this.accrualBusinessDayAdjustment = accrualBusinessDayAdjustment;
 }
 // parse inflation method with convention defaults
 private static PriceIndexCalculationMethod parseInflationMethod(Optional <string> strOpt, Currency currency)
 {
     if (!strOpt.Present)
     {
         if (Currency.JPY.Equals(currency))
         {
             return(PriceIndexCalculationMethod.INTERPOLATED_JAPAN);
         }
         else if (Currency.USD.Equals(currency))
         {
             return(PriceIndexCalculationMethod.INTERPOLATED);
         }
         return(PriceIndexCalculationMethod.MONTHLY);
     }
     return(PriceIndexCalculationMethod.of(strOpt.get()));
 }
Esempio n. 5
0
 /// <summary>
 /// Sets reference price index calculation method.
 /// <para>
 /// This specifies how the reference index calculation occurs.
 /// </para>
 /// <para>
 /// This will default to 'Monthly' if not specified.
 /// </para>
 /// </summary>
 /// <param name="indexCalculationMethod">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder indexCalculationMethod(PriceIndexCalculationMethod indexCalculationMethod)
 {
     JodaBeanUtils.notNull(indexCalculationMethod, "indexCalculationMethod");
     this.indexCalculationMethod_Renamed = indexCalculationMethod;
     return(this);
 }
Esempio n. 6
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains a convention based on the specified index.
 /// <para>
 /// The standard market convention for an Inflation rate leg is based on the index.
 /// Use the <seealso cref="#builder() builder"/> for unusual conventions.
 ///
 /// </para>
 /// </summary>
 /// <param name="index">  the index, the market convention values are extracted from the index </param>
 /// <param name="lag">  the lag between the price index and the accrual date, typically a number of months </param>
 /// <param name="priceIndexCalculationMethod">  the price index calculation method, typically interpolated or monthly </param>
 /// <param name="businessDayAdjustment">  the business day </param>
 /// <returns> the convention </returns>
 public static InflationRateSwapLegConvention of(PriceIndex index, Period lag, PriceIndexCalculationMethod priceIndexCalculationMethod, BusinessDayAdjustment businessDayAdjustment)
 {
     return(new InflationRateSwapLegConvention(index, lag, priceIndexCalculationMethod, false, DaysAdjustment.NONE, businessDayAdjustment));
 }