Class TermDeposit
- java.lang.Object
-
- com.opengamma.strata.product.deposit.TermDeposit
-
- All Implemented Interfaces:
Resolvable<ResolvedTermDeposit>
,Product
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class TermDeposit extends Object implements Product, Resolvable<ResolvedTermDeposit>, org.joda.beans.ImmutableBean, Serializable
A term deposit.A term deposit is a financial instrument that provides a fixed rate of interest on an amount for a specific term. For example, investing GBP 1,000 for 3 months at a 1% interest rate.
The instrument has two payments, one at the start date and one at the end date. For example, investing GBP 1,000 for 3 months implies an initial payment to the counterparty of GBP 1,000 and a final payment from the counterparty of GBP 1,000 plus interest.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TermDeposit.Builder
The bean-builder forTermDeposit
.static class
TermDeposit.Meta
The meta-bean forTermDeposit
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableSet<Currency>
allCurrencies()
Returns the set of currencies the product refers to.static TermDeposit.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
Optional<BusinessDayAdjustment>
getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date, optional.BuySell
getBuySell()
Gets whether the term deposit is 'Buy' or 'Sell'.Currency
getCurrency()
Gets the primary currency.DayCount
getDayCount()
Gets the day count convention.LocalDate
getEndDate()
Gets the end date of the deposit.double
getNotional()
Gets the notional amount.double
getRate()
Gets the fixed interest rate to be paid.LocalDate
getStartDate()
Gets the start date of the deposit.int
hashCode()
static TermDeposit.Meta
meta()
The meta-bean forTermDeposit
.TermDeposit.Meta
metaBean()
ResolvedTermDeposit
resolve(ReferenceData refData)
Resolves this object using the specified reference data.TermDeposit.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Product
allPaymentCurrencies, isCrossCurrency
-
-
-
-
Method Detail
-
allCurrencies
public ImmutableSet<Currency> allCurrencies()
Description copied from interface:Product
Returns the set of currencies the product refers to.This returns the complete set of currencies, not just the payment currencies. For example, the sets will differ when one of the currencies is non-deliverable.
- Specified by:
allCurrencies
in interfaceProduct
- Returns:
- the set of currencies the product refers to
-
resolve
public ResolvedTermDeposit resolve(ReferenceData refData)
Description copied from interface:Resolvable
Resolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataId
identifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolve
in interfaceResolvable<ResolvedTermDeposit>
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static TermDeposit.Meta meta()
The meta-bean forTermDeposit
.- Returns:
- the meta-bean, not null
-
builder
public static TermDeposit.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public TermDeposit.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getBuySell
public BuySell getBuySell()
Gets whether the term deposit is 'Buy' or 'Sell'.A value of 'Buy' implies payment of the principal at the start date and receipt of the principal plus interest at the end date. A value of 'Sell' implies the opposite. In other words, 'Buy' refers to buying the service of "money storage", with the benefit of receiving interest.
- Returns:
- the value of the property, not null
-
getCurrency
public Currency getCurrency()
Gets the primary currency.This is the currency of the term deposit and the currency that payment is made in.
- Returns:
- the value of the property, not null
-
getNotional
public double getNotional()
Gets the notional amount.The notional represents the principal amount, and must be non-negative. The currency of the notional is specified by
currency
.- Returns:
- the value of the property
-
getStartDate
public LocalDate getStartDate()
Gets the start date of the deposit.Interest accrues from this date. This date is typically set to be a valid business day. Optionally, the
businessDayAdjustment
property may be set to provide a rule for adjustment.- Returns:
- the value of the property, not null
-
getEndDate
public LocalDate getEndDate()
Gets the end date of the deposit.Interest accrues until this date. This date is typically set to be a valid business day. Optionally, the
businessDayAdjustment
property may be set to provide a rule for adjustment. This date must be after the start date.- Returns:
- the value of the property, not null
-
getBusinessDayAdjustment
public Optional<BusinessDayAdjustment> getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date, optional.The start and end date are typically defined as valid business days and thus do not need to be adjusted. If this optional property is present, then the start and end date will be adjusted as defined here.
- Returns:
- the optional 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
-
getRate
public double getRate()
Gets the fixed interest rate to be paid. A 5% rate will be expressed as 0.05.- Returns:
- the value of the property
-
toBuilder
public TermDeposit.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-