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 classImmutableTermDepositConvention.BuilderThe bean-builder forImmutableTermDepositConvention.static classImmutableTermDepositConvention.MetaThe meta-bean forImmutableTermDepositConvention.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTermDepositConvention.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)BusinessDayAdjustmentgetBusinessDayAdjustment()Gets the business day adjustment to apply to the start and end date.CurrencygetCurrency()Gets the primary currency.DayCountgetDayCount()Gets the day count convention.StringgetName()Gets the convention name, such as 'GBP-Deposit-ON'.DaysAdjustmentgetSpotDateOffset()Gets the offset of the spot value date from the trade date.inthashCode()static ImmutableTermDepositConvention.Metameta()The meta-bean forImmutableTermDepositConvention.ImmutableTermDepositConvention.MetametaBean()static ImmutableTermDepositConventionof(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.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()TermDepositTradetoTrade(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:TermDepositConventionCreates 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:
toTradein 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:
metaBeanin 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:
getCurrencyin interfaceTermDepositConvention- Returns:
- the value of the property, not null
-
getName
public String getName()
Gets the convention name, such as 'GBP-Deposit-ON'.- Specified by:
getNamein interfaceNamed- Specified by:
getNamein 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:
getSpotDateOffsetin 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
-
-