@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.tenor != null) { builder.label = builder.tenor.toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.tenor != null) { builder.label = builder.tenor.toString(); } }
public void test_toString() { assertEquals(TENOR_3D.toString(), "3D"); assertEquals(TENOR_2W.toString(), "2W"); assertEquals(TENOR_4M.toString(), "4M"); assertEquals(TENOR_12M.toString(), "12M"); assertEquals(TENOR_1Y.toString(), "1Y"); assertEquals(TENOR_18M.toString(), "18M"); assertEquals(TENOR_4Y.toString(), "4Y"); }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
/** * Obtains an instance using the tenor. * * @param tenor the tenor associated with the parameter * @return the parameter metadata based on the tenor */ public static TenorParameterMetadata of(Tenor tenor) { ArgChecker.notNull(tenor, "tenor"); return new TenorParameterMetadata(tenor, tenor.toString()); }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = builder.template.getTenor().toString(); } }
@Override public IborIndex toIborIndex(Tenor tenor) { if (!type.isIbor()) { throw new IllegalStateException("Incorrect index type, expected Ibor: " + externalName); } return IborIndex.of(indexName + tenor.normalized().toString()); }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = Tenor.of(builder.template.getPeriodToEnd()).toString(); } }
/** * Obtains an instance using the tenor. * * @param date the date associated with the parameter * @param tenor the tenor associated with the parameter * @return the parameter metadata based on the tenor */ public static TenorDateParameterMetadata of(LocalDate date, Tenor tenor) { ArgChecker.notNull(date, "date"); ArgChecker.notNull(tenor, "tenor"); return new TenorDateParameterMetadata(date, tenor, tenor.toString()); }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.label == null && builder.template != null) { builder.label = Tenor.of(builder.template.getDepositPeriod()).toString(); } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.template != null) { if (builder.label == null) { builder.label = builder.template instanceof TenorCdsTemplate ? ((TenorCdsTemplate) builder.template).getTenor().toString() : ((DatesCdsTemplate) builder.template).getEndDate().toString(); } } }
@ImmutablePreBuild private static void preBuild(Builder builder) { if (builder.template != null) { if (builder.label == null) { builder.label = builder.template instanceof TenorCdsTemplate ? ((TenorCdsTemplate) builder.template).getTenor().toString() : ((DatesCdsTemplate) builder.template).getEndDate().toString(); } } }
@Test(dataProvider = "ofPeriod") public void test_ofPeriod(Period period, Period stored, String str) { assertEquals(Tenor.of(period).getPeriod(), stored); assertEquals(Tenor.of(period).toString(), str); }
@Test(dataProvider = "ofMonths") public void test_ofMonths(int months, Period stored, String str) { assertEquals(Tenor.ofMonths(months).getPeriod(), stored); assertEquals(Tenor.ofMonths(months).toString(), str); }
@Test(dataProvider = "ofYears") public void test_ofYears(int years, Period stored, String str) { assertEquals(Tenor.ofYears(years).getPeriod(), stored); assertEquals(Tenor.ofYears(years).toString(), str); }
public void test_of() { SwapIsdaCreditCurveNode test = SwapIsdaCreditCurveNode.of(OBS_ID, ADJ_3D, BUS_ADJ, TENOR, THIRTY_U_360, FREQUENCY); assertEquals(test.getBusinessDayAdjustment(), BUS_ADJ); assertEquals(test.getDayCount(), THIRTY_U_360); assertEquals(test.getLabel(), TENOR.toString()); assertEquals(test.getObservableId(), OBS_ID); assertEquals(test.getPaymentFrequency(), FREQUENCY); assertEquals(test.getSpotDateOffset(), ADJ_3D); assertEquals(test.getTenor(), TENOR); assertEquals(test.date(TRADE_DATE, REF_DATA), LocalDate.of(2026, 10, 5)); assertEquals(test.metadata(LocalDate.of(2026, 10, 5)), TenorDateParameterMetadata.of(LocalDate.of(2026, 10, 5), TENOR)); }