Class ImmutableCdsConvention
- java.lang.Object
-
- com.opengamma.strata.product.credit.type.ImmutableCdsConvention
-
- All Implemented Interfaces:
Named
,CdsConvention
,TradeConvention
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ImmutableCdsConvention extends Object implements CdsConvention, org.joda.beans.ImmutableBean, Serializable
A market convention for credit default swap trades.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableCdsConvention.Builder
The bean-builder forImmutableCdsConvention
.static class
ImmutableCdsConvention.Meta
The meta-bean forImmutableCdsConvention
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableCdsConvention.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
BusinessDayAdjustment
getBusinessDayAdjustment()
Gets the business day adjustment to apply to payment schedule dates.Currency
getCurrency()
Gets the currency of the CDS.DayCount
getDayCount()
Gets the day count convention applicable.BusinessDayAdjustment
getEndDateBusinessDayAdjustment()
Gets the business day adjustment to apply to the end date, providing a default result if no override specified.String
getName()
Gets the convention name.Frequency
getPaymentFrequency()
Gets the periodic frequency of payments.PaymentOnDefault
getPaymentOnDefault()
Gets the payment on default.ProtectionStartOfDay
getProtectionStart()
Gets the protection start of the day.RollConvention
getRollConvention()
Gets the convention defining how to roll dates, optional with defaulting getter.DaysAdjustment
getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.BusinessDayAdjustment
getStartDateBusinessDayAdjustment()
Gets the business day adjustment to apply to the start date, providing a default result if no override specified.DaysAdjustment
getStepinDateOffset()
Gets the number of days between valuation date and step-in date.StubConvention
getStubConvention()
Gets the convention defining how to handle stubs, optional with defaulting getter.int
hashCode()
static ImmutableCdsConvention.Meta
meta()
The meta-bean forImmutableCdsConvention
.ImmutableCdsConvention.Meta
metaBean()
static ImmutableCdsConvention
of(String name, Currency currency, DayCount dayCount, Frequency paymentFrequency, BusinessDayAdjustment businessDayAdjustment, DaysAdjustment settlementDateOffset)
Obtains a convention based on the specified parameters.ImmutableCdsConvention.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
CdsTrade
toTrade(StandardId legalEntityId, TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate)
Creates a CDS trade withTradeInfo
.CdsTrade
toTrade(StandardId legalEntityId, TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate, AdjustablePayment upfrontFee)
Creates a CDS trade with upfront fee andTradeInfo
.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.credit.type.CdsConvention
createTrade, createTrade, createTrade, createTrade, createTrade, createTrade
-
-
-
-
Method Detail
-
of
public static ImmutableCdsConvention of(String name, Currency currency, DayCount dayCount, Frequency paymentFrequency, BusinessDayAdjustment businessDayAdjustment, DaysAdjustment settlementDateOffset)
Obtains a convention based on the specified parameters.- Parameters:
name
- the name of the conventioncurrency
- the currencydayCount
- the day countpaymentFrequency
- the payment frequencybusinessDayAdjustment
- the business day adjustmentsettlementDateOffset
- the settlement date offset- Returns:
- the CDS convention
-
getStartDateBusinessDayAdjustment
public BusinessDayAdjustment getStartDateBusinessDayAdjustment()
Gets the business day adjustment to apply to the start date, providing a default result if no override specified.The start date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the start date to a valid business day.
This will default to the
businessDayAdjustment
if not specified.- Returns:
- the start date business day adjustment, not null
-
getEndDateBusinessDayAdjustment
public BusinessDayAdjustment getEndDateBusinessDayAdjustment()
Gets the business day adjustment to apply to the end date, providing a default result if no override specified.The end date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the end date to a valid business day.
This will default to the 'None' if not specified.
- Returns:
- the end date business day adjustment, not null
-
toTrade
public CdsTrade toTrade(StandardId legalEntityId, TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate)
Description copied from interface:CdsConvention
Creates a CDS trade withTradeInfo
.- Specified by:
toTrade
in interfaceCdsConvention
- Parameters:
legalEntityId
- the legal entity IDtradeInfo
- the trade infostartDate
- the start dateendDate
- the end datebuySell
- buy or sellnotional
- the notionalfixedRate
- the fixed rate- Returns:
- the CDS trade
-
toTrade
public CdsTrade toTrade(StandardId legalEntityId, TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate, AdjustablePayment upfrontFee)
Description copied from interface:CdsConvention
Creates a CDS trade with upfront fee andTradeInfo
.- Specified by:
toTrade
in interfaceCdsConvention
- Parameters:
legalEntityId
- the legal entity IDtradeInfo
- the trade infostartDate
- the start dateendDate
- the end datebuySell
- buy or sellnotional
- the notionalfixedRate
- the fixed rateupfrontFee
- the upFront fee- Returns:
- the CDS trade
-
meta
public static ImmutableCdsConvention.Meta meta()
The meta-bean forImmutableCdsConvention
.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableCdsConvention.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableCdsConvention.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getName
public String getName()
Gets the convention name.- Specified by:
getName
in interfaceCdsConvention
- Specified by:
getName
in interfaceNamed
- Returns:
- the value of the property, not null
-
getCurrency
public Currency getCurrency()
Gets the currency of the CDS.The amounts of the notional are expressed in terms of this currency.
- Specified by:
getCurrency
in interfaceCdsConvention
- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention applicable.This is used to convert schedule period dates to a numerical value.
- Returns:
- the value of the property, not null
-
getPaymentFrequency
public Frequency getPaymentFrequency()
Gets the periodic frequency of payments.Regular payments will be made at the specified periodic frequency. This also defines the accrual periodic frequency.
- Returns:
- the value of the property, not null
-
getBusinessDayAdjustment
public BusinessDayAdjustment getBusinessDayAdjustment()
Gets the business day adjustment to apply to payment schedule dates.Each date in the calculated schedule is determined without taking into account weekends and holidays. The adjustment specified here is used to convert those dates to valid business days.
The start date and end date may have their own business day adjustment rules. If those are not present, then this adjustment is used instead.
- Returns:
- the value of the property, not null
-
getStubConvention
public StubConvention getStubConvention()
Gets the convention defining how to handle stubs, optional with defaulting getter.The stub convention is used during schedule construction to determine whether the irregular remaining period occurs at the start or end of the schedule. It also determines whether the irregular period is shorter or longer than the regular period.
This will default to 'SmartInitial' if not specified.
- Returns:
- the value of the property, not null
-
getRollConvention
public RollConvention getRollConvention()
Gets the convention defining how to roll dates, optional with defaulting getter.The schedule periods are determined at the high level by repeatedly adding the frequency to the start date, or subtracting it from the end date. The roll convention provides the detailed rule to adjust the day-of-month or day-of-week.
This will default to 'Day20' if not specified.
- Returns:
- the value of the property, not null
-
getPaymentOnDefault
public PaymentOnDefault getPaymentOnDefault()
Gets the payment on default.Whether the accrued premium is paid in the event of a default.
This will default to 'accrued premium' if not specified.
- Returns:
- the value of the property, not null
-
getProtectionStart
public ProtectionStartOfDay getProtectionStart()
Gets the protection start of the day.When the protection starts on the start date.
This will default to 'beginning of the start day' if not specified.
- Returns:
- the value of the property, not null
-
getStepinDateOffset
public DaysAdjustment getStepinDateOffset()
Gets the number of days between valuation date and step-in date.The step-in date is also called protection effective date.
This will default to '1 calendar day' if not specified.
- Returns:
- the value of the property, not null
-
getSettlementDateOffset
public DaysAdjustment getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.It is usually 3 business days for standardised CDS contracts.
- Specified by:
getSettlementDateOffset
in interfaceCdsConvention
- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableCdsConvention.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-