/** * Obtains an instance from an index and period dates. * * @param index the index * @param startDate the first date of the accrual period * @param endDate the last date of the accrual period * @param refData the reference data to use when resolving holiday calendars * @return the rate computation */ public static OvernightCompoundedAnnualRateComputation of( OvernightIndex index, LocalDate startDate, LocalDate endDate, ReferenceData refData) { return OvernightCompoundedAnnualRateComputation.builder() .index(index) .fixingCalendar(index.getFixingCalendar().resolve(refData)) .startDate(index.calculateFixingFromEffective(startDate, refData)) .endDate(index.calculateFixingFromEffective(endDate, refData)) .build(); }