Class RateAccrualPeriod.Builder
- java.lang.Object
-
- org.joda.beans.impl.direct.DirectFieldsBeanBuilder<RateAccrualPeriod>
-
- com.opengamma.strata.product.swap.RateAccrualPeriod.Builder
-
- All Implemented Interfaces:
org.joda.beans.BeanBuilder<RateAccrualPeriod>
- Enclosing class:
- RateAccrualPeriod
public static final class RateAccrualPeriod.Builder extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<RateAccrualPeriod>
The bean-builder forRateAccrualPeriod
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RateAccrualPeriod
build()
RateAccrualPeriod.Builder
endDate(LocalDate endDate)
Sets the end date of the accrual period.RateAccrualPeriod.Builder
gearing(double gearing)
Sets the gearing multiplier, defaulted to 1.Object
get(String propertyName)
RateAccrualPeriod.Builder
negativeRateMethod(NegativeRateMethod negativeRateMethod)
Sets the negative rate method, defaulted to 'AllowNegative'.RateAccrualPeriod.Builder
rateComputation(RateComputation rateComputation)
Sets the rate to be computed.RateAccrualPeriod.Builder
set(String propertyName, Object newValue)
RateAccrualPeriod.Builder
set(org.joda.beans.MetaProperty<?> property, Object value)
RateAccrualPeriod.Builder
spread(double spread)
Sets the spread rate, defaulted to 0.RateAccrualPeriod.Builder
startDate(LocalDate startDate)
Sets the start date of the accrual period.String
toString()
RateAccrualPeriod.Builder
unadjustedEndDate(LocalDate unadjustedEndDate)
Sets the unadjusted end date.RateAccrualPeriod.Builder
unadjustedStartDate(LocalDate unadjustedStartDate)
Sets the unadjusted start date.RateAccrualPeriod.Builder
yearFraction(double yearFraction)
Sets the year fraction that the accrual period represents.
-
-
-
Method Detail
-
get
public Object get(String propertyName)
- Specified by:
get
in interfaceorg.joda.beans.BeanBuilder<RateAccrualPeriod>
- Overrides:
get
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<RateAccrualPeriod>
-
set
public RateAccrualPeriod.Builder set(String propertyName, Object newValue)
-
set
public RateAccrualPeriod.Builder set(org.joda.beans.MetaProperty<?> property, Object value)
- Specified by:
set
in interfaceorg.joda.beans.BeanBuilder<RateAccrualPeriod>
- Overrides:
set
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<RateAccrualPeriod>
-
build
public RateAccrualPeriod build()
-
startDate
public RateAccrualPeriod.Builder startDate(LocalDate startDate)
Sets the start date of the accrual period.This is the first accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.
- Parameters:
startDate
- the new value, not null- Returns:
- this, for chaining, not null
-
endDate
public RateAccrualPeriod.Builder endDate(LocalDate endDate)
Sets the end date of the accrual period.This is the last accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.
- Parameters:
endDate
- the new value, not null- Returns:
- this, for chaining, not null
-
unadjustedStartDate
public RateAccrualPeriod.Builder unadjustedStartDate(LocalDate unadjustedStartDate)
Sets the unadjusted start date.The start date before any business day adjustment is applied.
When building, this will default to the start date if not specified.
- Parameters:
unadjustedStartDate
- the new value, not null- Returns:
- this, for chaining, not null
-
unadjustedEndDate
public RateAccrualPeriod.Builder unadjustedEndDate(LocalDate unadjustedEndDate)
Sets the unadjusted end date.The end date before any business day adjustment is applied.
When building, this will default to the end date if not specified.
- Parameters:
unadjustedEndDate
- the new value, not null- Returns:
- this, for chaining, not null
-
yearFraction
public RateAccrualPeriod.Builder yearFraction(double yearFraction)
Sets the year fraction that the accrual period represents.The value is usually calculated using a
DayCount
which may be different to that of the index. Typically the value will be close to 1 for one year and close to 0.5 for six months. The fraction may be greater than 1, but not less than 0.- Parameters:
yearFraction
- the new value- Returns:
- this, for chaining, not null
-
rateComputation
public RateAccrualPeriod.Builder rateComputation(RateComputation rateComputation)
Sets the rate to be computed.The value of the period is based on this rate. Different implementations of the
RateComputation
interface have different approaches to computing the rate, including averaging, overnight and interpolation. For example, it might be a well known market index such as 'GBP-LIBOR-3M'.- Parameters:
rateComputation
- the new value, not null- Returns:
- this, for chaining, not null
-
gearing
public RateAccrualPeriod.Builder gearing(double gearing)
Sets the gearing multiplier, defaulted to 1.This defines the gearing, which is used to multiply the observed rate.
When calculating the rate, the observed rate is multiplied by the gearing. If both gearing and spread exist, then the gearing is applied first. A gearing of 1 has no effect.
Gearing is also known as leverage.
- Parameters:
gearing
- the new value- Returns:
- this, for chaining, not null
-
spread
public RateAccrualPeriod.Builder spread(double spread)
Sets the spread rate, defaulted to 0. A 5% rate will be expressed as 0.05.This defines the spread, which is used to add an amount the observed rate.
When calculating the rate, the spread is added to the observed rate. If both gearing and spread exist, then the gearing is applied first. A spread of 0 has no effect.
Defined by the 2006 ISDA definitions article 6.2e.
- Parameters:
spread
- the new value- Returns:
- this, for chaining, not null
-
negativeRateMethod
public RateAccrualPeriod.Builder negativeRateMethod(NegativeRateMethod negativeRateMethod)
Sets the negative rate method, defaulted to 'AllowNegative'.This is used when the interest rate, observed or calculated, goes negative.
When observing or calculating the rate, the value may go negative. If it does, then this method is used to validate whether the negative rate is allowed. It is applied after any applicable gearing or spread.
Defined by the 2006 ISDA definitions article 6.4.
- Parameters:
negativeRateMethod
- the new value, not null- Returns:
- this, for chaining, not null
-
toString
public String toString()
- Overrides:
toString
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<RateAccrualPeriod>
-
-