public void test_builder_full() { ImmutableTermDepositConvention test = ImmutableTermDepositConvention.builder() .name("Test") .businessDayAdjustment(BDA_MOD_FOLLOW) .currency(EUR) .dayCount(ACT_360) .spotDateOffset(PLUS_TWO_DAYS) .build(); assertEquals(test.getName(), "Test"); assertEquals(test.getBusinessDayAdjustment(), BDA_MOD_FOLLOW); assertEquals(test.getCurrency(), EUR); assertEquals(test.getDayCount(), ACT_360); assertEquals(test.getSpotDateOffset(), PLUS_TWO_DAYS); }
/** * Obtains a convention based on the specified currency, business day adjustment, * day count convention and spot date offset. * * @param name the name of the convention, such as 'GBP-Deposit-ON' * @param currency the currency, in which the payments are made * @param businessDayAdjustment the business day adjustment to apply to the start and end date * @param dayCount the day count convention, used to convert dates to a numerical value * @param spotDateOffset the offset of the spot value date from the trade date * @return the convention */ public static ImmutableTermDepositConvention of( String name, Currency currency, BusinessDayAdjustment businessDayAdjustment, DayCount dayCount, DaysAdjustment spotDateOffset) { return ImmutableTermDepositConvention.builder() .name(name) .currency(currency) .businessDayAdjustment(businessDayAdjustment) .dayCount(dayCount) .spotDateOffset(spotDateOffset) .build(); }
@Override public ImmutableTermDepositConvention.Builder builder() { return new ImmutableTermDepositConvention.Builder(); }
/** * Returns a builder that allows this bean to be mutated. * @return the mutable builder, not null */ public Builder toBuilder() { return new Builder(this); }
/** * Returns a builder used to create an instance of the bean. * @return the builder, not null */ public static ImmutableTermDepositConvention.Builder builder() { return new ImmutableTermDepositConvention.Builder(); }