Class TermDepositTemplate
- java.lang.Object
-
- com.opengamma.strata.product.deposit.type.TermDepositTemplate
-
- All Implemented Interfaces:
TradeTemplate
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class TermDepositTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
A template for creating a term deposit trade.This defines almost all the data necessary to create a
TermDeposit
. The trade date, notional and fixed rate are required to complete the template and create the trade. As such, it is often possible to get a market price for a trade based on the template. The market price is typically quoted as a bid/ask on the fixed rate.The template 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 implied deposit ends, typically a number of months after the start date
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TermDepositTemplate.Builder
The bean-builder forTermDepositTemplate
.static class
TermDepositTemplate.Meta
The meta-bean forTermDepositTemplate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TermDepositTemplate.Builder
builder()
Returns a builder used to create an instance of the bean.TermDepositTrade
createTrade(LocalDate tradeDate, BuySell buySell, double notional, double rate, ReferenceData refData)
Creates a trade based on this template.boolean
equals(Object obj)
TermDepositConvention
getConvention()
Gets the underlying term deposit convention.Period
getDepositPeriod()
Gets the period between the start date and the end date.int
hashCode()
static TermDepositTemplate.Meta
meta()
The meta-bean forTermDepositTemplate
.TermDepositTemplate.Meta
metaBean()
static TermDepositTemplate
of(Period depositPeriod, TermDepositConvention convention)
Obtains a template based on the specified period and convention.TermDepositTemplate.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
of
public static TermDepositTemplate of(Period depositPeriod, TermDepositConvention convention)
Obtains a template based on the specified period and convention.- Parameters:
depositPeriod
- the period between the start date and the end dateconvention
- the market convention- Returns:
- the template
-
createTrade
public TermDepositTrade createTrade(LocalDate tradeDate, BuySell buySell, double notional, double rate, ReferenceData refData)
Creates a trade based on this template.This returns a trade based on the specified date. 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.
- Parameters:
tradeDate
- the date of the tradebuySell
- the buy/sell flag, seeTermDeposit.getBuySell()
notional
- the notional amount, in the payment currency of the templaterate
- the fixed rate, typically derived from the marketrefData
- the reference data, used to resolve the trade dates- Returns:
- the trade
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference data
-
meta
public static TermDepositTemplate.Meta meta()
The meta-bean forTermDepositTemplate
.- Returns:
- the meta-bean, not null
-
builder
public static TermDepositTemplate.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public TermDepositTemplate.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getDepositPeriod
public Period getDepositPeriod()
Gets the period between the start date and the end date.- Returns:
- the value of the property, not null
-
getConvention
public TermDepositConvention getConvention()
Gets the underlying term deposit convention.This specifies the standard convention of the term deposit to be created.
- Returns:
- the value of the property, not null
-
toBuilder
public TermDepositTemplate.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-