Class ImmutableTermDepositConvention
- java.lang.Object
-
- com.opengamma.strata.product.deposit.type.ImmutableTermDepositConvention
-
- All Implemented Interfaces:
Named
,TermDepositConvention
,TradeConvention
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ImmutableTermDepositConvention extends Object implements TermDepositConvention, org.joda.beans.ImmutableBean, Serializable
A market convention for term deposit trades.This defines the market convention for a term deposit.
The convention is defined by three dates.
- Trade date, the date that the trade is agreed
- Start date or spot date, the date on which the deposit starts, typically 2 business days after the trade date
- End date, the date on which the deposit ends, typically a number of months after the start date
TermDepositTemplate
, not by this convention.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableTermDepositConvention.Builder
The bean-builder forImmutableTermDepositConvention
.static class
ImmutableTermDepositConvention.Meta
The meta-bean forImmutableTermDepositConvention
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTermDepositConvention.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 the start and end date.Currency
getCurrency()
Gets the primary currency.DayCount
getDayCount()
Gets the day count convention.String
getName()
Gets the convention name, such as 'GBP-Deposit-ON'.DaysAdjustment
getSpotDateOffset()
Gets the offset of the spot value date from the trade date.int
hashCode()
static ImmutableTermDepositConvention.Meta
meta()
The meta-bean forImmutableTermDepositConvention
.ImmutableTermDepositConvention.Meta
metaBean()
static ImmutableTermDepositConvention
of(String name, Currency currency, BusinessDayAdjustment businessDayAdjustment, DayCount dayCount, DaysAdjustment spotDateOffset)
Obtains a convention based on the specified currency, business day adjustment, day count convention and spot date offset.ImmutableTermDepositConvention.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
TermDepositTrade
toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double rate)
Creates a trade based on this convention.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.deposit.type.TermDepositConvention
calculateSpotDateFromTradeDate, createTrade, createTrade, toTrade
-
-
-
-
Method Detail
-
of
public static ImmutableTermDepositConvention of(String name, Currency currency, BusinessDayAdjustment businessDayAdjustment, DayCount dayCount, DaysAdjustment spotDateOffset)
Obtains a convention based on the specified currency, business day adjustment, day count convention and spot date offset.- Parameters:
name
- the name of the convention, such as 'GBP-Deposit-ON'currency
- the currency, in which the payments are madebusinessDayAdjustment
- the business day adjustment to apply to the start and end datedayCount
- the day count convention, used to convert dates to a numerical valuespotDateOffset
- the offset of the spot value date from the trade date- Returns:
- the convention
-
toTrade
public TermDepositTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double rate)
Description copied from interface:TermDepositConvention
Creates a trade based on this convention.This returns a trade based on the specified dates. The notional is unsigned, with buy/sell determining the direction of the trade. If buying the term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.
- Specified by:
toTrade
in interfaceTermDepositConvention
- Parameters:
tradeInfo
- additional information about the tradestartDate
- the start dateendDate
- the end datebuySell
- the buy/sell flagnotional
- the notional amount, in the payment currency of the templaterate
- the fixed rate, typically derived from the market- Returns:
- the trade
-
meta
public static ImmutableTermDepositConvention.Meta meta()
The meta-bean forImmutableTermDepositConvention
.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableTermDepositConvention.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableTermDepositConvention.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getCurrency
public Currency getCurrency()
Gets the primary currency.This is the currency of the term deposit and the currency that payment is made in.
- Specified by:
getCurrency
in interfaceTermDepositConvention
- Returns:
- the value of the property, not null
-
getName
public String getName()
Gets the convention name, such as 'GBP-Deposit-ON'.- Specified by:
getName
in interfaceNamed
- Specified by:
getName
in interfaceTermDepositConvention
- Returns:
- the value of the property, not null
-
getBusinessDayAdjustment
public BusinessDayAdjustment getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date.The start and end date will be adjusted as defined here.
- 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.
- Returns:
- the value of the property, not null
-
getSpotDateOffset
public DaysAdjustment getSpotDateOffset()
Gets the offset of the spot value date from the trade date.The offset is applied to the trade date and is typically plus 2 business days. The start date of the term deposit is equal to the spot date and the end date of the term deposit is relative to the start date.
- Specified by:
getSpotDateOffset
in interfaceTermDepositConvention
- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableTermDepositConvention.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-