public final class PaymentSchedule extends Object implements org.joda.beans.ImmutableBean, Serializable
This defines the data necessary to create a schedule of payment periods. Each payment period contains one or more accrual periods. If a payment period contains more than one accrual period then the compounding method will be used to combine the amounts.
This class defines payment periods using a periodic frequency. The frequency must match or be a multiple of the accrual periodic frequency.
If the payment frequency is 'Term' then there is only one payment. As such, a 'Term' payment frequency causes stubs to be treated solely as accrual periods. In all other cases, stubs are treated as payment periods in their own right.
When applying the frequency, it is converted into an integer value, representing the number of accrual periods per payment period. The accrual periods are allocated by rolling forwards or backwards, applying the same direction as accrual schedule generation.
A different business day adjustment may be specified for the payment schedule to that
used for the accrual schedule. When resolving the swap, the adjustment will be applied
as part of the process that creates the payment date. Note that the start and end dates
of the payment period, as defined by the payment schedule, cannot be observed on the
resulting RatePaymentPeriod instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
PaymentSchedule.Builder
The bean-builder for
PaymentSchedule. |
static class |
PaymentSchedule.Meta
The meta-bean for
PaymentSchedule. |
| Modifier and Type | Method and Description |
|---|---|
static PaymentSchedule.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
Schedule |
createSchedule(Schedule accrualSchedule,
ReferenceData refData)
Creates the payment schedule based on the accrual schedule.
|
boolean |
equals(Object obj) |
Optional<BusinessDayAdjustment> |
getBusinessDayAdjustment()
Gets the business day adjustment to apply, optional.
|
CompoundingMethod |
getCompoundingMethod()
Gets the compounding method to use when there is more than one accrual period, defaulted to 'None'.
|
Optional<LocalDate> |
getFirstRegularStartDate()
Gets the optional start date of the first regular payment schedule period, which is the end date of the initial stub.
|
Optional<LocalDate> |
getLastRegularEndDate()
Gets the optional end date of the last regular payment schedule period, which is the start date of the final stub.
|
DaysAdjustment |
getPaymentDateOffset()
Gets the offset of payment from the base calculation period date.
|
Frequency |
getPaymentFrequency()
Gets the periodic frequency of payments.
|
PaymentRelativeTo |
getPaymentRelativeTo()
Gets the base date that each payment is made relative to, defaulted to 'PeriodEnd'.
|
int |
hashCode() |
static PaymentSchedule.Meta |
meta()
The meta-bean for
PaymentSchedule. |
PaymentSchedule.Meta |
metaBean() |
PaymentSchedule.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
public Schedule createSchedule(Schedule accrualSchedule, ReferenceData refData)
If the payment frequency matches the accrual frequency, or if there is only one period in the accrual schedule, the input schedule is returned.
Only the regular part of the accrual schedule is grouped into payment periods. Any initial or final stub will be returned unaltered in the new schedule.
The grouping is determined by rolling forwards or backwards through the regular accrual periods Rolling is backwards if there is an initial stub, otherwise rolling is forwards. Grouping involves merging the existing accrual periods, thus the roll convention of the accrual periods is implicitly applied.
accrualSchedule - the accrual schedulerefData - the reference data to use when resolvingReferenceDataNotFoundException - if an identifier cannot be resolved in the reference dataIllegalArgumentException - if the accrual frequency does not divide evenly into the payment frequencypublic static PaymentSchedule.Meta meta()
PaymentSchedule.public static PaymentSchedule.Builder builder()
public PaymentSchedule.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic Frequency getPaymentFrequency()
Regular payments will be made at the specified periodic frequency. The frequency must be the same as, or a multiple of, the accrual periodic frequency.
Compounding applies if the payment frequency does not equal the accrual frequency.
public Optional<BusinessDayAdjustment> getBusinessDayAdjustment()
Each date in the calculated schedule is determined relative to the accrual schedule. Normally, the accrual schedule is adjusted ensuring each date is not a holiday. As such, there is typically no reason to adjust the date before applying the payment date offset.
If the accrual dates are unadjusted, or for some other reason, it may be desirable to adjust the schedule dates before applying the payment date offset. This optional property allows that to happen. Note that the payment date offset itself provides the ability to adjust dates after the offset is applied.
public PaymentRelativeTo getPaymentRelativeTo()
The payment date is relative to either the start or end of the payment period.
public DaysAdjustment getPaymentDateOffset()
The offset is applied to the unadjusted date specified by paymentRelativeTo.
Offset can be based on calendar days or business days.
public CompoundingMethod getCompoundingMethod()
Compounding is used when combining accrual periods.
public Optional<LocalDate> getFirstRegularStartDate()
This is used to identify the boundary date between the initial stub and the first regular period. In most cases there is no need to specify this as it can be worked out from other information. It must be used when there is a need to produce a payment schedule with an initial stub that combines an initial stub from the accrual schedule with the first regular period of the accrual schedule.
This is an unadjusted date, and as such it might not be a valid business day. It must equal one of the unadjusted dates on the accrual schedule.
If paymentRelativeTo is 'PeriodEnd' then this field
corresponds to firstPaymentDate in FpML.
public Optional<LocalDate> getLastRegularEndDate()
This is used to identify the boundary date between the last regular period and the final stub. In most cases there is no need to specify this as it can be worked out from other information. It must be used when there is a need to produce a payment schedule with a final stub that combines a final stub from the accrual schedule with the last regular period of the accrual schedule.
This is used to identify the boundary date between the last regular schedule period and the final stub.
This is an unadjusted date, and as such it might not be a valid business day. This date must be after 'firstPaymentDate'. It must equal one of the unadjusted dates on the accrual schedule.
If paymentRelativeTo is 'PeriodEnd' then this field
corresponds to lastRegularPaymentDate in FpML.
public PaymentSchedule.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.