@Override public FxIndexObservation build() { return new FxIndexObservation( index, fixingDate, maturityDate); }
/** * Creates an instance from an index and fixing date. * <p> * The reference data is used to find the maturity date from the fixing date. * * @param index the index * @param fixingDate the fixing date * @param refData the reference data to use when resolving holiday calendars * @return the rate observation */ public static FxIndexObservation of(FxIndex index, LocalDate fixingDate, ReferenceData refData) { LocalDate maturityDate = index.calculateMaturityFromFixing(fixingDate, refData); return new FxIndexObservation(index, fixingDate, maturityDate); }
private FxIndexObservation create( LocalDate fixingDate, HolidayCalendar fixingCal, DateAdjuster maturityAdjuster) { LocalDate fixingBusinessDay = fixingCal.nextOrSame(fixingDate); LocalDate maturityDate = maturityAdjuster.adjust(fixingBusinessDay); return new FxIndexObservation(this, fixingDate, maturityDate); }