Class NotionalSchedule
- java.lang.Object
-
- com.opengamma.strata.product.swap.NotionalSchedule
-
- All Implemented Interfaces:
Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class NotionalSchedule extends Object implements org.joda.beans.ImmutableBean, Serializable
Defines the schedule of notional amounts.Interest rate swaps are based on a notional amount of money. The notional can vary during the lifetime of the swap, but only at payment period boundaries. It is not permitted to vary at an intermediate accrual (compounding) period boundary.
In most cases, the notional amount is not exchanged, with only the net difference being exchanged. However, in certain cases, initial, final or intermediate amounts are exchanged. In this case, the notional can be referred to as the principal.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NotionalSchedule.Builder
The bean-builder forNotionalSchedule
.static class
NotionalSchedule.Meta
The meta-bean forNotionalSchedule
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NotionalSchedule.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
ValueSchedule
getAmount()
Gets the notional amount.Currency
getCurrency()
Gets the currency of the swap leg associated with the notional.Optional<FxResetCalculation>
getFxReset()
Gets the FX reset definition, optional.int
hashCode()
boolean
isFinalExchange()
Gets the flag indicating whether to exchange the final notional.boolean
isInitialExchange()
Gets the flag indicating whether to exchange the initial notional.boolean
isIntermediateExchange()
Gets the flag indicating whether to exchange the differences in the notional during the lifetime of the swap.static NotionalSchedule.Meta
meta()
The meta-bean forNotionalSchedule
.NotionalSchedule.Meta
metaBean()
static NotionalSchedule
of(CurrencyAmount notional)
Obtains an instance with a single amount that does not change over time.static NotionalSchedule
of(Currency currency, double amount)
Obtains an instance with a single amount that does not change over time.static NotionalSchedule
of(Currency currency, ValueSchedule amountSchedule)
Obtains an instance with a notional amount that can change over time.NotionalSchedule.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
of
public static NotionalSchedule of(CurrencyAmount notional)
Obtains an instance with a single amount that does not change over time.- Parameters:
notional
- the single notional that does not change over time- Returns:
- the notional amount
-
of
public static NotionalSchedule of(Currency currency, double amount)
Obtains an instance with a single amount that does not change over time.- Parameters:
currency
- the currency of the notional and swap paymentsamount
- the single notional amount that does not change over time- Returns:
- the notional amount
-
of
public static NotionalSchedule of(Currency currency, ValueSchedule amountSchedule)
Obtains an instance with a notional amount that can change over time.- Parameters:
currency
- the currency of the notional and swap paymentsamountSchedule
- the schedule describing how the notional changes over time- Returns:
- the notional amount
-
meta
public static NotionalSchedule.Meta meta()
The meta-bean forNotionalSchedule
.- Returns:
- the meta-bean, not null
-
builder
public static NotionalSchedule.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public NotionalSchedule.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getCurrency
public Currency getCurrency()
Gets the currency of the swap leg associated with the notional.This is the currency of the swap leg and the currency that interest calculation is made in.
The amounts of the notional are usually expressed in terms of this currency, however they can be converted from amounts in a different currency. See the optional
fxReset
property.- Returns:
- the value of the property, not null
-
getFxReset
public Optional<FxResetCalculation> getFxReset()
Gets the FX reset definition, optional.This property is used when the defined amount of the notional is specified in a currency other than the currency of the swap leg. When this occurs, the notional amount has to be converted using an FX rate to the swap leg currency. This conversion occurs at each payment period boundary and usually corresponds to an actual exchange of money between the counterparties.
When building the notional schedule, if an
FxResetCalculation
is present, then at least one of the notional exchange flags should be set to true. If all notional exchange flags are false then an IllegalArgumentException is thrown.- Returns:
- the optional value of the property, not null
-
getAmount
public ValueSchedule getAmount()
Gets the notional amount.This defines the notional as an initial amount and a list of adjustments. The notional expressed here is intended to always be positive.
The notional is only allowed to change at payment period boundaries. As such, the
ValueSchedule
steps are defined relative to the payment schedule.- Returns:
- the value of the property, not null
-
isInitialExchange
public boolean isInitialExchange()
Gets the flag indicating whether to exchange the initial notional.Setting this to true indicates that the notional is transferred at the start of the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.
- Returns:
- the value of the property
-
isIntermediateExchange
public boolean isIntermediateExchange()
Gets the flag indicating whether to exchange the differences in the notional during the lifetime of the swap.Setting this to true indicates that the notional is transferred when it changes during the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.
- Returns:
- the value of the property
-
isFinalExchange
public boolean isFinalExchange()
Gets the flag indicating whether to exchange the final notional.Setting this to true indicates that the notional is transferred at the end of the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.
- Returns:
- the value of the property
-
toBuilder
public NotionalSchedule.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-