Ejemplo n.º 1
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(OvernightRateCalculation beanToCopy)
 {
     this.dayCount_Renamed           = beanToCopy.DayCount;
     this.index_Renamed              = beanToCopy.Index;
     this.accrualMethod_Renamed      = beanToCopy.AccrualMethod;
     this.negativeRateMethod_Renamed = beanToCopy.NegativeRateMethod;
     this.rateCutOffDays_Renamed     = beanToCopy.RateCutOffDays;
     this.gearing_Renamed            = beanToCopy.gearing;
     this.spread_Renamed             = beanToCopy.spread;
 }
 // trusted constructor
 internal RateAccrualPeriod(SchedulePeriod period, double yearFraction, RateComputation rateComputation, double gearing, double spread, NegativeRateMethod negativeRateMethod)
 {
     this.startDate           = period.StartDate;
     this.endDate             = period.EndDate;
     this.unadjustedStartDate = period.UnadjustedStartDate;
     this.unadjustedEndDate   = period.UnadjustedEndDate;
     this.yearFraction        = yearFraction;
     this.rateComputation     = rateComputation;
     this.gearing             = gearing;
     this.spread             = spread;
     this.negativeRateMethod = negativeRateMethod;
 }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(RateAccrualPeriod beanToCopy)
 {
     this.startDate_Renamed           = beanToCopy.StartDate;
     this.endDate_Renamed             = beanToCopy.EndDate;
     this.unadjustedStartDate_Renamed = beanToCopy.UnadjustedStartDate;
     this.unadjustedEndDate_Renamed   = beanToCopy.UnadjustedEndDate;
     this.yearFraction_Renamed        = beanToCopy.YearFraction;
     this.rateComputation_Renamed     = beanToCopy.RateComputation;
     this.gearing_Renamed             = beanToCopy.Gearing;
     this.spread_Renamed             = beanToCopy.Spread;
     this.negativeRateMethod_Renamed = beanToCopy.NegativeRateMethod;
 }
Ejemplo n.º 4
0
 private OvernightRateCalculation(DayCount dayCount, OvernightIndex index, OvernightAccrualMethod accrualMethod, NegativeRateMethod negativeRateMethod, int rateCutOffDays, ValueSchedule gearing, ValueSchedule spread)
 {
     JodaBeanUtils.notNull(dayCount, "dayCount");
     JodaBeanUtils.notNull(index, "index");
     JodaBeanUtils.notNull(accrualMethod, "accrualMethod");
     JodaBeanUtils.notNull(negativeRateMethod, "negativeRateMethod");
     ArgChecker.notNegative(rateCutOffDays, "rateCutOffDays");
     this.dayCount           = dayCount;
     this.index              = index;
     this.accrualMethod      = accrualMethod;
     this.negativeRateMethod = negativeRateMethod;
     this.rateCutOffDays     = rateCutOffDays;
     this.gearing            = gearing;
     this.spread             = spread;
 }
        // could use @ImmutablePreBuild and @ImmutableValidate but faster inline
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @ImmutableConstructor private RateAccrualPeriod(java.time.LocalDate startDate, java.time.LocalDate endDate, java.time.LocalDate unadjustedStartDate, java.time.LocalDate unadjustedEndDate, double yearFraction, com.opengamma.strata.product.rate.RateComputation rateComputation, double gearing, double spread, NegativeRateMethod negativeRateMethod)
        private RateAccrualPeriod(LocalDate startDate, LocalDate endDate, LocalDate unadjustedStartDate, LocalDate unadjustedEndDate, double yearFraction, RateComputation rateComputation, double gearing, double spread, NegativeRateMethod negativeRateMethod)
        {
            this.startDate           = ArgChecker.notNull(startDate, "startDate");
            this.endDate             = ArgChecker.notNull(endDate, "endDate");
            this.unadjustedStartDate = firstNonNull(unadjustedStartDate, startDate);
            this.unadjustedEndDate   = firstNonNull(unadjustedEndDate, endDate);
            this.yearFraction        = ArgChecker.notNegative(yearFraction, "yearFraction");
            this.rateComputation     = ArgChecker.notNull(rateComputation, "rateComputation");
            this.gearing             = gearing;
            this.spread             = spread;
            this.negativeRateMethod = ArgChecker.notNull(negativeRateMethod, "negativeRateMethod");
            // check for unadjusted must be after firstNonNull
            ArgChecker.inOrderNotEqual(startDate, endDate, "startDate", "endDate");
            ArgChecker.inOrderNotEqual(this.unadjustedStartDate, this.unadjustedEndDate, "unadjustedStartDate", "unadjustedEndDate");
        }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case -2129778896:         // startDate
                    this.startDate_Renamed = (LocalDate)newValue;
                    break;

                case -1607727319:         // endDate
                    this.endDate_Renamed = (LocalDate)newValue;
                    break;

                case 1457691881:         // unadjustedStartDate
                    this.unadjustedStartDate_Renamed = (LocalDate)newValue;
                    break;

                case 31758114:         // unadjustedEndDate
                    this.unadjustedEndDate_Renamed = (LocalDate)newValue;
                    break;

                case -1731780257:         // yearFraction
                    this.yearFraction_Renamed = (double?)newValue.Value;
                    break;

                case 625350855:         // rateComputation
                    this.rateComputation_Renamed = (RateComputation)newValue;
                    break;

                case -91774989:         // gearing
                    this.gearing_Renamed = (double?)newValue.Value;
                    break;

                case -895684237:         // spread
                    this.spread_Renamed = (double?)newValue.Value;
                    break;

                case 1969081334:         // negativeRateMethod
                    this.negativeRateMethod_Renamed = (NegativeRateMethod)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Ejemplo n.º 7
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 1905311443:         // dayCount
                    this.dayCount_Renamed = (DayCount)newValue;
                    break;

                case 100346066:         // index
                    this.index_Renamed = (OvernightIndex)newValue;
                    break;

                case -1335729296:         // accrualMethod
                    this.accrualMethod_Renamed = (OvernightAccrualMethod)newValue;
                    break;

                case 1969081334:         // negativeRateMethod
                    this.negativeRateMethod_Renamed = (NegativeRateMethod)newValue;
                    break;

                case -92095804:         // rateCutOffDays
                    this.rateCutOffDays_Renamed = (int?)newValue.Value;
                    break;

                case -91774989:         // gearing
                    this.gearing_Renamed = (ValueSchedule)newValue;
                    break;

                case -895684237:         // spread
                    this.spread_Renamed = (ValueSchedule)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Ejemplo n.º 8
0
 /// <summary>
 /// Sets the negative rate method, defaulted to 'AllowNegative'.
 /// <para>
 /// This is used when the interest rate, observed or calculated, goes negative.
 /// It does not apply if the rate is fixed, such as in a stub or using {@code firstRegularRate}.
 /// </para>
 /// <para>
 /// Defined by the 2006 ISDA definitions article 6.4.
 /// </para>
 /// </summary>
 /// <param name="negativeRateMethod">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder negativeRateMethod(NegativeRateMethod negativeRateMethod)
 {
     JodaBeanUtils.notNull(negativeRateMethod, "negativeRateMethod");
     this.negativeRateMethod_Renamed = negativeRateMethod;
     return(this);
 }
 public virtual void test_of_lookup_null()
 {
     assertThrows(() => NegativeRateMethod.of(null), typeof(System.ArgumentException));
 }
 public virtual void test_of_lookup_notFound()
 {
     assertThrows(() => NegativeRateMethod.of("Rubbish"), typeof(System.ArgumentException));
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_of_lookup(NegativeRateMethod convention, String name)
        public virtual void test_of_lookup(NegativeRateMethod convention, string name)
        {
            assertEquals(NegativeRateMethod.of(name), convention);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test(dataProvider = "name") public void test_toString(NegativeRateMethod convention, String name)
        public virtual void test_toString(NegativeRateMethod convention, string name)
        {
            assertEquals(convention.ToString(), name);
        }