"Swap leg must not define both '" + leg + INITIAL_STUB_RATE_FIELD + "' and '" + leg + INITIAL_STUB_AMOUNT_FIELD + "'"); initialStubRateOpt.ifPresent(v -> builder.initialStub( FixedRateStubCalculation.ofFixedRate(v))); initialStubAmountOpt.ifPresent(v -> builder.initialStub( FixedRateStubCalculation.ofKnownAmount(CurrencyAmount.of(currency, v))));
fixedRateBuilder.initialStub(parseStubCalculationForFixed(el, document)); }); stubsEl.findChild("finalStub").ifPresent(el -> {
public void test_builder() { FixedRateCalculation test = FixedRateCalculation.builder() .dayCount(ACT_365F) .rate(ValueSchedule.of(0.025d)) .initialStub(FixedRateStubCalculation.ofFixedRate(0.1d)) .finalStub(FixedRateStubCalculation.ofFixedRate(0.2d)) .futureValueNotional(FutureValueNotional.autoCalculate()) .build(); assertEquals(test.getRate(), ValueSchedule.of(0.025d)); assertEquals(test.getDayCount(), ACT_365F); assertEquals(test.getInitialStub(), Optional.of(FixedRateStubCalculation.ofFixedRate(0.1d))); assertEquals(test.getFinalStub(), Optional.of(FixedRateStubCalculation.ofFixedRate(0.2d))); assertEquals(test.getFutureValueNotional(), Optional.of(FutureValueNotional.autoCalculate())); }
.dayCount(ACT_365F) .rate(ValueSchedule.of(0.025d)) .initialStub(FixedRateStubCalculation.ofKnownAmount(knownAmount)) .finalStub(FixedRateStubCalculation.ofFixedRate(0.1d)) .build())