//------------------------------------------------------------------------- public virtual void test_builder() { ImmutableFxSwapConvention test = ImmutableFxSwapConvention.builder().currencyPair(EUR_USD).name("EUR::USD").spotDateOffset(PLUS_TWO_DAYS).businessDayAdjustment(BDA_FOLLOW).build(); assertEquals(test.Name, "EUR::USD"); assertEquals(test.CurrencyPair, EUR_USD); assertEquals(test.SpotDateOffset, PLUS_TWO_DAYS); assertEquals(test.BusinessDayAdjustment, BDA_FOLLOW); }
//------------------------------------------------------------------------- public virtual void coverage() { ImmutableFxSwapConvention test = ImmutableFxSwapConvention.of(EUR_USD, PLUS_TWO_DAYS, BDA_FOLLOW); coverImmutableBean(test); ImmutableFxSwapConvention test2 = ImmutableFxSwapConvention.builder().name("GBP/USD").currencyPair(GBP_USD).spotDateOffset(PLUS_ONE_DAY).businessDayAdjustment(BDA_MODFOLLOW).build(); coverBeanEquals(test, test2); }
/// <summary> /// Obtains a convention based on the specified currency pair, spot date offset and adjustment. /// <para> /// Use the <seealso cref="#builder() builder"/> for unusual conventions. /// /// </para> /// </summary> /// <param name="currencyPair"> the currency pair associated to the convention </param> /// <param name="spotDateOffset"> the spot date offset </param> /// <param name="businessDayAdjustment"> the business day adjustment to apply </param> /// <returns> the convention </returns> public static ImmutableFxSwapConvention of(CurrencyPair currencyPair, DaysAdjustment spotDateOffset, BusinessDayAdjustment businessDayAdjustment) { ArgChecker.notNull(businessDayAdjustment, "businessDayAdjustment"); return(ImmutableFxSwapConvention.builder().currencyPair(currencyPair).spotDateOffset(spotDateOffset).businessDayAdjustment(businessDayAdjustment).build()); }
//------------------------------------------------------------------------- /// <summary> /// Obtains a convention based on the specified currency pair and spot date offset. /// <para> /// Use the <seealso cref="#builder() builder"/> for unusual conventions. /// /// </para> /// </summary> /// <param name="currencyPair"> the currency pair associated to the convention </param> /// <param name="spotDateOffset"> the spot date offset </param> /// <returns> the convention </returns> public static ImmutableFxSwapConvention of(CurrencyPair currencyPair, DaysAdjustment spotDateOffset) { return(ImmutableFxSwapConvention.builder().currencyPair(currencyPair).spotDateOffset(spotDateOffset).build()); }