/** * Restricted copy constructor. * @param beanToCopy the bean to copy from, not null */ private Builder(ImmutableFxSwapConvention beanToCopy) { this.currencyPair = beanToCopy.getCurrencyPair(); this.name = beanToCopy.name; this.spotDateOffset = beanToCopy.getSpotDateOffset(); this.businessDayAdjustment = beanToCopy.businessDayAdjustment; }
@Override protected Object propertyGet(Bean bean, String propertyName, boolean quiet) { switch (propertyName.hashCode()) { case 1005147787: // currencyPair return ((ImmutableFxSwapConvention) bean).getCurrencyPair(); case 3373707: // name return ((ImmutableFxSwapConvention) bean).name; case 746995843: // spotDateOffset return ((ImmutableFxSwapConvention) bean).getSpotDateOffset(); case -1065319863: // businessDayAdjustment return ((ImmutableFxSwapConvention) bean).businessDayAdjustment; } return super.propertyGet(bean, propertyName, quiet); }
@Test(dataProvider = "currencyPair") public void test_currency_pair(ImmutableFxSwapConvention convention, CurrencyPair ccys) { assertEquals(convention.getCurrencyPair(), ccys); }
public void test_of_bda() { ImmutableFxSwapConvention test = ImmutableFxSwapConvention.of(EUR_USD, PLUS_TWO_DAYS, BDA_FOLLOW); assertEquals(test.getName(), EUR_USD.toString()); assertEquals(test.getCurrencyPair(), EUR_USD); assertEquals(test.getSpotDateOffset(), PLUS_TWO_DAYS); assertEquals(test.getBusinessDayAdjustment(), BDA_FOLLOW); }
public void test_of_nobda() { ImmutableFxSwapConvention test = ImmutableFxSwapConvention.of(EUR_USD, PLUS_TWO_DAYS); assertEquals(test.getName(), EUR_USD.toString()); assertEquals(test.getCurrencyPair(), EUR_USD); assertEquals(test.getSpotDateOffset(), PLUS_TWO_DAYS); assertEquals(test.getBusinessDayAdjustment(), BusinessDayAdjustment.of(MODIFIED_FOLLOWING, EUTA_USNY)); }
public void test_builder() { ImmutableFxSwapConvention test = ImmutableFxSwapConvention.builder() .currencyPair(EUR_USD) .name("EUR::USD") .spotDateOffset(PLUS_TWO_DAYS) .businessDayAdjustment(BDA_FOLLOW) .build(); assertEquals(test.getName(), "EUR::USD"); assertEquals(test.getCurrencyPair(), EUR_USD); assertEquals(test.getSpotDateOffset(), PLUS_TWO_DAYS); assertEquals(test.getBusinessDayAdjustment(), BDA_FOLLOW); }