/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(OvernightCompoundedAnnualRateComputation beanToCopy) { this.index = beanToCopy.getIndex(); this.fixingCalendar = beanToCopy.getFixingCalendar(); this.startDate = beanToCopy.getStartDate(); this.endDate = beanToCopy.getEndDate(); }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 100346066: // index return ((OvernightCompoundedAnnualRateComputation) bean).getIndex(); case 394230283: // fixingCalendar return ((OvernightCompoundedAnnualRateComputation) bean).getFixingCalendar(); case -2129778896: // startDate return ((OvernightCompoundedAnnualRateComputation) bean).getStartDate(); case -1607727319: // endDate return ((OvernightCompoundedAnnualRateComputation) bean).getEndDate(); } return super.propertyGet(bean, propertyName, quiet); }
public void test_of() { OvernightCompoundedAnnualRateComputation test = sut(); assertEquals(test.getStartDate(), date(2016, 2, 24)); assertEquals(test.getEndDate(), date(2016, 3, 24)); assertEquals(test.getIndex(), BRL_CDI); assertEquals(test.getFixingCalendar(), BRL_CDI.getFixingCalendar().resolve(REF_DATA)); }
private ObservationDetails(OvernightCompoundedAnnualRateComputation computation, OvernightIndexRates rates) { this.computation = computation; this.rates = rates; this.indexFixingDateSeries = rates.getFixings(); this.dayCount = computation.getIndex().getDayCount(); this.firstFixing = computation.getStartDate(); this.lastFixingP1 = computation.getEndDate(); this.lastFixing = computation.getFixingCalendar().previous(lastFixingP1); LocalDate startUnderlyingPeriod = computation.calculateEffectiveFromFixing(firstFixing); LocalDate endUnderlyingPeriod = computation.calculateMaturityFromFixing(lastFixing); this.accrualFactorTotal = dayCount.yearFraction(startUnderlyingPeriod, endUnderlyingPeriod); }