Class Cds.Builder

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

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

      • get

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

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

        public Cds build()
      • buySell

        public Cds.Builder buySell​(BuySell buySell)
        Sets whether the CDS is buy or sell.

        A value of 'Buy' implies buying protection, where the fixed coupon is paid and the protection is received in the event of default. A value of 'Sell' implies selling protection, where the fixed coupon is received and the protection is paid in the event of default.

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

        public Cds.Builder legalEntityId​(StandardId legalEntityId)
        Sets the legal entity identifier.

        This identifier is used for the reference legal entity of the CDS.

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

        public Cds.Builder currency​(Currency currency)
        Sets the currency of the CDS.

        The amounts of the notional are expressed in terms of this currency.

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

        public Cds.Builder notional​(double notional)
        Sets the notional amount, must be non-negative.

        The fixed notional amount applicable during the lifetime of the CDS. The currency of the notional is specified by currency.

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

        public Cds.Builder paymentSchedule​(PeriodicSchedule paymentSchedule)
        Sets the payment schedule.

        This is used to define the payment periods.

        Parameters:
        paymentSchedule - the new value, not null
        Returns:
        this, for chaining, not null
      • fixedRate

        public Cds.Builder fixedRate​(double fixedRate)
        Sets the fixed coupon rate.

        This must be represented in decimal form.

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

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

        This is used to convert dates to a numerical value.

        When building, this will default to 'Act/360'.

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

        public Cds.Builder paymentOnDefault​(PaymentOnDefault paymentOnDefault)
        Sets the payment on default.

        Whether the accrued premium is paid in the event of a default.

        When building, this will default to 'AccruedPremium'.

        Parameters:
        paymentOnDefault - the new value, not null
        Returns:
        this, for chaining, not null
      • protectionStart

        public Cds.Builder protectionStart​(ProtectionStartOfDay protectionStart)
        Sets the protection start of the day.

        When the protection starts on the start date.

        When building, this will default to 'Beginning'.

        Parameters:
        protectionStart - the new value, not null
        Returns:
        this, for chaining, not null
      • stepinDateOffset

        public Cds.Builder stepinDateOffset​(DaysAdjustment stepinDateOffset)
        Sets the number of days between valuation date and step-in date.

        The step-in date is also called protection effective date. It is usually 1 calendar day for standardized CDS contracts.

        When building, this will default to 1 calendar day.

        Parameters:
        stepinDateOffset - the new value, not null
        Returns:
        this, for chaining, not null
      • settlementDateOffset

        public Cds.Builder settlementDateOffset​(DaysAdjustment settlementDateOffset)
        Sets the number of days between valuation date and settlement date.

        It is usually 3 business days for standardized CDS contracts.

        When building, this will default to 3 business days in the calendar of the payment schedule.

        Parameters:
        settlementDateOffset - the new value, not null
        Returns:
        this, for chaining, not null
      • toString

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