/// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ResolvedOvernightFuture beanToCopy)
 {
     this.securityId_Renamed    = beanToCopy.SecurityId;
     this.currency_Renamed      = beanToCopy.Currency;
     this.notional_Renamed      = beanToCopy.Notional;
     this.accrualFactor_Renamed = beanToCopy.AccrualFactor;
     this.lastTradeDate_Renamed = beanToCopy.LastTradeDate;
     this.overnightRate_Renamed = beanToCopy.OvernightRate;
     this.rounding_Renamed      = beanToCopy.Rounding;
 }
 /// <summary>
 /// Creates an instance. </summary>
 /// <param name="securityId">  the value of the property, not null </param>
 /// <param name="currency">  the value of the property, not null </param>
 /// <param name="notional">  the value of the property </param>
 /// <param name="accrualFactor">  the value of the property </param>
 /// <param name="lastTradeDate">  the value of the property, not null </param>
 /// <param name="overnightRate">  the value of the property, not null </param>
 /// <param name="rounding">  the value of the property, not null </param>
 internal ResolvedOvernightFuture(SecurityId securityId, Currency currency, double notional, double accrualFactor, LocalDate lastTradeDate, OvernightRateComputation overnightRate, Rounding rounding)
 {
     JodaBeanUtils.notNull(securityId, "securityId");
     JodaBeanUtils.notNull(currency, "currency");
     ArgChecker.notNegativeOrZero(notional, "notional");
     ArgChecker.notNegativeOrZero(accrualFactor, "accrualFactor");
     JodaBeanUtils.notNull(lastTradeDate, "lastTradeDate");
     JodaBeanUtils.notNull(overnightRate, "overnightRate");
     JodaBeanUtils.notNull(rounding, "rounding");
     this.securityId    = securityId;
     this.currency      = currency;
     this.notional      = notional;
     this.accrualFactor = accrualFactor;
     this.lastTradeDate = lastTradeDate;
     this.overnightRate = overnightRate;
     this.rounding      = rounding;
 }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 1574023291:         // securityId
                    this.securityId_Renamed = (SecurityId)newValue;
                    break;

                case 575402001:         // currency
                    this.currency_Renamed = (Currency)newValue;
                    break;

                case 1585636160:         // notional
                    this.notional_Renamed = (double?)newValue.Value;
                    break;

                case -1540322338:         // accrualFactor
                    this.accrualFactor_Renamed = (double?)newValue.Value;
                    break;

                case -1041950404:         // lastTradeDate
                    this.lastTradeDate_Renamed = (LocalDate)newValue;
                    break;

                case -821605692:         // overnightRate
                    this.overnightRate_Renamed = (OvernightRateComputation)newValue;
                    break;

                case -142444:         // rounding
                    this.rounding_Renamed = (Rounding)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Example #4
0
        // creates the rate computation
        private RateComputation createRateComputation(SchedulePeriod period, Schedule paymentSchedule, ReferenceData refData)
        {
            int effectiveRateCutOffDaysOffset = (isLastAccrualInPaymentPeriod(period, paymentSchedule) ? rateCutOffDays : 0);

            return(OvernightRateComputation.of(index, period.StartDate, period.EndDate, effectiveRateCutOffDaysOffset, accrualMethod, refData));
        }
 /// <summary>
 /// Sets the Overnight rate observation.
 /// <para>
 /// The future is based on this index.
 /// It will be a well known market index such as 'USD-FED-FUND'.
 /// </para>
 /// </summary>
 /// <param name="overnightRate">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder overnightRate(OvernightRateComputation overnightRate)
 {
     JodaBeanUtils.notNull(overnightRate, "overnightRate");
     this.overnightRate_Renamed = overnightRate;
     return(this);
 }