Class TermDeposit.Builder

  • All Implemented Interfaces:
    org.joda.beans.BeanBuilder<TermDeposit>
    Enclosing class:
    TermDeposit

    public static final class TermDeposit.Builder
    extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<TermDeposit>
    The bean-builder for TermDeposit.
    • Method Detail

      • get

        public Object get​(String propertyName)
        Specified by:
        get in interface org.joda.beans.BeanBuilder<TermDeposit>
        Overrides:
        get in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<TermDeposit>
      • set

        public TermDeposit.Builder set​(org.joda.beans.MetaProperty<?> property,
                                       Object value)
        Specified by:
        set in interface org.joda.beans.BeanBuilder<TermDeposit>
        Overrides:
        set in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<TermDeposit>
      • buySell

        public TermDeposit.Builder buySell​(BuySell buySell)
        Sets 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.

        Parameters:
        buySell - the new value, not null
        Returns:
        this, for chaining, not null
      • currency

        public TermDeposit.Builder currency​(Currency currency)
        Sets the primary currency.

        This is the currency of the term deposit and the currency that payment is made in.

        Parameters:
        currency - the new value, not null
        Returns:
        this, for chaining, not null
      • notional

        public TermDeposit.Builder notional​(double notional)
        Sets the notional amount.

        The notional represents the principal amount, and must be non-negative. The currency of the notional is specified by currency.

        Parameters:
        notional - the new value
        Returns:
        this, for chaining, not null
      • startDate

        public TermDeposit.Builder startDate​(LocalDate startDate)
        Sets 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.

        Parameters:
        startDate - the new value, not null
        Returns:
        this, for chaining, not null
      • endDate

        public TermDeposit.Builder endDate​(LocalDate endDate)
        Sets 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.

        Parameters:
        endDate - the new value, not null
        Returns:
        this, for chaining, not null
      • businessDayAdjustment

        public TermDeposit.Builder businessDayAdjustment​(BusinessDayAdjustment businessDayAdjustment)
        Sets 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.

        Parameters:
        businessDayAdjustment - the new value
        Returns:
        this, for chaining, not null
      • dayCount

        public TermDeposit.Builder dayCount​(DayCount dayCount)
        Sets the day count convention.

        This is used to convert dates to a numerical value.

        Parameters:
        dayCount - the new value, not null
        Returns:
        this, for chaining, not null
      • rate

        public TermDeposit.Builder rate​(double rate)
        Sets the fixed interest rate to be paid. A 5% rate will be expressed as 0.05.
        Parameters:
        rate - the new value
        Returns:
        this, for chaining, not null
      • toString

        public String toString()
        Overrides:
        toString in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<TermDeposit>