Class CmsLeg
- java.lang.Object
-
- com.opengamma.strata.product.cms.CmsLeg
-
- All Implemented Interfaces:
Resolvable<ResolvedCmsLeg>
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class CmsLeg extends Object implements Resolvable<ResolvedCmsLeg>, org.joda.beans.ImmutableBean, Serializable
A CMS leg of a constant maturity swap (CMS) product.This defines a single CMS leg for CMS or CMS cap/floor. The CMS leg of CMS periodically pays coupons based on swap rate, which is the observed value of a swap index. A CMS cap/floor instruments are defined as a set of call/put options on successive swap rates, creating CMS caplets/floorlets.
The periodic payments in the resolved leg are CMS coupons, CMS caplets or CMS floorlets depending on the data in this leg. The
capSchedule
field is used to represent strike values of individual caplets, whereasfloorSchedule
is used to represent strike values of individual floorlets. Thus at least one ofcapSchedule
andfloorSchedule
must be empty. If both the fields are absent, the periodic payments in this leg are CMS coupons.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsLeg.Builder
The bean-builder forCmsLeg
.static class
CmsLeg.Meta
The meta-bean forCmsLeg
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CmsLeg.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
Optional<ValueSchedule>
getCapSchedule()
Gets the cap schedule, optional.Currency
getCurrency()
Gets the currency of the leg associated with the notional.DayCount
getDayCount()
Gets the day count convention.AdjustableDate
getEndDate()
Gets the accrual end date of the leg.DaysAdjustment
getFixingDateOffset()
Gets the offset of the fixing date from each adjusted reset date.FixingRelativeTo
getFixingRelativeTo()
Gets the base date that each fixing is made relative to, defaulted to 'PeriodStart'.Optional<ValueSchedule>
getFloorSchedule()
Gets the floor schedule, optional.SwapIndex
getIndex()
Gets the swap index.ValueSchedule
getNotional()
Gets the notional amount, must be non-negative.DaysAdjustment
getPaymentDateOffset()
Gets the offset of payment from the base calculation period date.PeriodicSchedule
getPaymentSchedule()
Gets the periodic payment schedule.PayReceive
getPayReceive()
Gets whether the leg is pay or receive.AdjustableDate
getStartDate()
Gets the accrual start date of the leg.RateIndex
getUnderlyingIndex()
Gets the underlying Rate index that the leg is based on.int
hashCode()
static CmsLeg.Meta
meta()
The meta-bean forCmsLeg
.CmsLeg.Meta
metaBean()
ResolvedCmsLeg
resolve(ReferenceData refData)
Resolves this object using the specified reference data.CmsLeg.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
getStartDate
public AdjustableDate getStartDate()
Gets the accrual start date of the leg.This is the first accrual date in the leg, often known as the effective date.
- Returns:
- the start date of the leg
-
getEndDate
public AdjustableDate getEndDate()
Gets the accrual end date of the leg.This is the last accrual date in the leg, often known as the termination date.
- Returns:
- the end date of the leg
-
getUnderlyingIndex
public RateIndex getUnderlyingIndex()
Gets the underlying Rate index that the leg is based on.- Returns:
- the index
-
resolve
public ResolvedCmsLeg resolve(ReferenceData refData)
Description copied from interface:Resolvable
Resolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataId
identifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolve
in interfaceResolvable<ResolvedCmsLeg>
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static CmsLeg.Meta meta()
The meta-bean forCmsLeg
.- Returns:
- the meta-bean, not null
-
builder
public static CmsLeg.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public CmsLeg.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getPayReceive
public PayReceive getPayReceive()
Gets 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 swap rates can result in a payment in the opposite direction to that implied by this indicator.
- Returns:
- the value of the property, not null
-
getPaymentSchedule
public PeriodicSchedule getPaymentSchedule()
Gets the periodic payment schedule.This is used to define the periodic payment periods. These are used directly or indirectly to determine other dates in the leg.
- Returns:
- the value of the property, not null
-
getPaymentDateOffset
public DaysAdjustment getPaymentDateOffset()
Gets the offset of payment from the base calculation period date.The offset is applied to the adjusted end date of each payment period. Offset can be based on calendar days or business days.
When building, this will default to the payment offset of the swap convention in the swap index if not specified.
- Returns:
- the value of the property, not null
-
getCurrency
public Currency getCurrency()
Gets the currency of the leg associated with the notional.This is the currency of the leg and the currency that swap rate calculation is made in. The amounts of the notional are expressed in terms of this currency.
- Returns:
- the value of the property, not null
-
getNotional
public ValueSchedule getNotional()
Gets the notional amount, must be non-negative.The notional amount applicable during the period. The currency of the notional is specified by
currency
.- Returns:
- the value of the property, not null
-
getIndex
public SwapIndex getIndex()
Gets the swap index.The swap rate to be paid is the observed value of this index.
- Returns:
- the value of the property, not null
-
getFixingRelativeTo
public FixingRelativeTo getFixingRelativeTo()
Gets the base date that each fixing is made relative to, defaulted to 'PeriodStart'.The fixing date is relative to either the start or end of each period.
- Returns:
- the value of the property, not null
-
getFixingDateOffset
public DaysAdjustment getFixingDateOffset()
Gets the offset of the fixing date from each adjusted reset date.The offset is applied to the base date specified by
fixingRelativeTo
. The offset is typically a negative number of business days.When building, this will default to the fixing offset of the swap convention in the swap index if not specified.
- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention.This is used to convert dates to a numerical value.
When building, this will default to the day count of the swap convention in the swap index if not specified.
- Returns:
- the value of the property, not null
-
getCapSchedule
public Optional<ValueSchedule> getCapSchedule()
Gets the cap schedule, optional.This defines the strike value of a cap as an initial value and a list of adjustments. Thus individual caplets may have different strike values. The cap rate is only allowed to change at payment period boundaries.
If the product is not a cap, the cap schedule will be absent.
- Returns:
- the optional value of the property, not null
-
getFloorSchedule
public Optional<ValueSchedule> getFloorSchedule()
Gets the floor schedule, optional.This defines the strike value of a floor as an initial value and a list of adjustments. Thus individual floorlets may have different strike values. The floor rate is only allowed to change at payment period boundaries.
If the product is not a floor, the floor schedule will be absent.
- Returns:
- the optional value of the property, not null
-
toBuilder
public CmsLeg.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-