/** * Obtains a template based on the specified period and index. * <p> * The period from the start date to the end is specified. * The convention will be created based on the index. * * @param depositPeriod the period between the start date and the end date * @param index the index that defines the market convention * @return the template */ public static IborFixingDepositTemplate of(Period depositPeriod, IborIndex index) { return of(depositPeriod, IborFixingDepositConvention.of(index)); }
@Test(dataProvider = "name") public void test_of_lookup(IborFixingDepositConvention convention, String name) { assertEquals(IborFixingDepositConvention.of(name), convention); }
/** * Obtains a template based on the specified index. * <p> * The period from the start date to the end date will be the tenor of the index. * The convention will be created based on the index. * * @param index the index that defines the market convention * @return the template */ public static IborFixingDepositTemplate of(IborIndex index) { return of(index.getTenor().getPeriod(), IborFixingDepositConvention.of(index)); }
public void test_of_lookup_notFound() { assertThrowsIllegalArg(() -> IborFixingDepositConvention.of("Rubbish")); }
public void test_of_lookup_null() { assertThrowsIllegalArg(() -> IborFixingDepositConvention.of((String) null)); }
@Test(dataProvider = "name") public void test_extendedEnum(IborFixingDepositConvention convention, String name) { IborFixingDepositConvention.of(name); // ensures map is populated ImmutableMap<String, IborFixingDepositConvention> map = IborFixingDepositConvention.extendedEnum().lookupAll(); assertEquals(map.get(name), convention); }
private static CurveNode curveIborFixingDepositCurveNode( String conventionStr, String label, QuoteId quoteId, double spread, CurveNodeDate date, CurveNodeDateOrder order) { IborFixingDepositConvention convention = IborFixingDepositConvention.of(conventionStr); IborFixingDepositTemplate template = IborFixingDepositTemplate.of( convention.getIndex().getTenor().getPeriod(), convention); return IborFixingDepositCurveNode.builder() .template(template) .rateId(quoteId) .additionalSpread(spread) .label(label) .date(date) .dateOrder(order) .build(); }
IborFixingDepositConvention c = IborFixingDepositConvention.of(EUR_EURIBOR_6M); ResolvedIborFixingDepositTrade fix0 = c.createTrade(VALUATION_DATE, EUR_EURIBOR_6M.getTenor().getPeriod(), BuySell.BUY, 1.0, 0.0, REF_DATA).resolve(REF_DATA);