public void test_resolve_unadjustedAccrualAdjustedPayment() { Swap test = Swap.builder() .legs(RateCalculationSwapLeg.builder() .payReceive(RECEIVE) .accrualSchedule(PeriodicSchedule.builder() .calculation(FixedRateCalculation.of(RATE, ACT_360)) .build()) .build(); RatePaymentPeriod pp1 = RatePaymentPeriod.builder() .paymentDate(date(2016, 2, 5)) // 3rd plus two days
/** * 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 Swap.Builder builder() { return new Swap.Builder(); }
/** * Sets the {@code legs} property in the builder * from an array of objects. * @param legs the new value, not empty * @return this, for chaining, not null */ public Builder legs(SwapLeg... legs) { return legs(ImmutableList.copyOf(legs)); }
public void test_builder_list() { Swap test = Swap.builder() .legs(ImmutableList.of(MOCK_GBP1, MOCK_USD1)) .build(); assertEquals(test.getLegs(), ImmutableList.of(MOCK_GBP1, MOCK_USD1)); assertEquals(test.isCrossCurrency(), true); assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(GBP, USD)); assertEquals(test.allCurrencies(), ImmutableSet.of(GBP, EUR, USD)); }
@Override public Swap.Builder builder() { return new Swap.Builder(); }