Class KnownAmountSwapLeg.Builder
- java.lang.Object
-
- org.joda.beans.impl.direct.DirectFieldsBeanBuilder<KnownAmountSwapLeg>
-
- com.opengamma.strata.product.swap.KnownAmountSwapLeg.Builder
-
- All Implemented Interfaces:
org.joda.beans.BeanBuilder<KnownAmountSwapLeg>
- Enclosing class:
- KnownAmountSwapLeg
public static final class KnownAmountSwapLeg.Builder extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<KnownAmountSwapLeg>
The bean-builder forKnownAmountSwapLeg
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KnownAmountSwapLeg.Builder
accrualSchedule(PeriodicSchedule accrualSchedule)
Sets the accrual period schedule.KnownAmountSwapLeg.Builder
amount(ValueSchedule amount)
Sets the known amount schedule.KnownAmountSwapLeg
build()
KnownAmountSwapLeg.Builder
currency(Currency currency)
Sets the currency of the swap leg.Object
get(String propertyName)
KnownAmountSwapLeg.Builder
paymentSchedule(PaymentSchedule paymentSchedule)
Sets the payment period schedule.KnownAmountSwapLeg.Builder
payReceive(PayReceive payReceive)
Sets whether the leg is pay or receive.KnownAmountSwapLeg.Builder
set(String propertyName, Object newValue)
KnownAmountSwapLeg.Builder
set(org.joda.beans.MetaProperty<?> property, Object value)
String
toString()
-
-
-
Method Detail
-
get
public Object get(String propertyName)
- Specified by:
get
in interfaceorg.joda.beans.BeanBuilder<KnownAmountSwapLeg>
- Overrides:
get
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<KnownAmountSwapLeg>
-
set
public KnownAmountSwapLeg.Builder set(String propertyName, Object newValue)
-
set
public KnownAmountSwapLeg.Builder set(org.joda.beans.MetaProperty<?> property, Object value)
- Specified by:
set
in interfaceorg.joda.beans.BeanBuilder<KnownAmountSwapLeg>
- Overrides:
set
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<KnownAmountSwapLeg>
-
build
public KnownAmountSwapLeg build()
-
payReceive
public KnownAmountSwapLeg.Builder payReceive(PayReceive payReceive)
Sets whether the leg is pay or receive.A value of 'Pay' implies that the resulting amount is paid to the counterparty. A value of 'Receive' implies that the resulting amount is received from the counterparty. Note that negative interest rates can result in a payment in the opposite direction to that implied by this indicator.
- Parameters:
payReceive
- the new value, not null- Returns:
- this, for chaining, not null
-
accrualSchedule
public KnownAmountSwapLeg.Builder accrualSchedule(PeriodicSchedule accrualSchedule)
Sets the accrual period schedule.This is used to define the accrual periods. These are used directly or indirectly to determine other dates in the swap.
- Parameters:
accrualSchedule
- the new value, not null- Returns:
- this, for chaining, not null
-
paymentSchedule
public KnownAmountSwapLeg.Builder paymentSchedule(PaymentSchedule paymentSchedule)
Sets the payment period schedule.This is used to define the payment periods, including any compounding. The payment period dates are based on the accrual schedule.
- Parameters:
paymentSchedule
- the new value, not null- Returns:
- this, for chaining, not null
-
amount
public KnownAmountSwapLeg.Builder amount(ValueSchedule amount)
Sets the known amount schedule.This defines the schedule of known amounts, relative to the payment schedule. The schedule is defined as an initial amount, with optional changes during the tenor of the swap. The amount is only permitted to change at payment period boundaries.
Note that the date of the payment is implied by the payment schedule. Any dates in the known amount schedule refer to the payment schedule, not the payment date.
For example, consider a two year swap where each payment period is 3 months long. This schedule could define two entries, one that defines the payment amounts as GBP 1000 for the first year and one that defines the amount as GBP 500 for the second year. In this case there will be eight payments in total, four payments of GBP 1000 in the first year and four payments of GBP 500 in the second year. Each payment will occur on the date specified using the offset in
PaymentSchedule
.- Parameters:
amount
- the new value, not null- Returns:
- this, for chaining, not null
-
currency
public KnownAmountSwapLeg.Builder currency(Currency currency)
Sets the currency of the swap leg.This is the currency of the known payments.
- Parameters:
currency
- the new value, not null- Returns:
- this, for chaining, not null
-
toString
public String toString()
- Overrides:
toString
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<KnownAmountSwapLeg>
-
-