Class Fra.Builder

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

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

      • get

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

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

        public Fra build()
      • buySell

        public Fra.Builder buySell​(BuySell buySell)
        Sets whether the FRA is buy or sell.

        A value of 'Buy' implies that the floating rate is received from the counterparty, with the fixed rate being paid. A value of 'Sell' implies that the floating rate is paid to the counterparty, with the fixed rate being received.

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

        public Fra.Builder currency​(Currency currency)
        Sets the primary currency, defaulted to the currency of the index.

        This is the currency of the FRA and the currency that payment is made in. The data model permits this currency to differ from that of the index, however the two are typically the same.

        When building, this will default to the currency of the index if not specified.

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

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

        The notional expressed here must be positive. The currency of the notional is specified by currency.

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

        public Fra.Builder startDate​(LocalDate startDate)
        Sets the start date, which is the effective date of the FRA.

        This is the first date that interest accrues.

        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 Fra.Builder endDate​(LocalDate endDate)
        Sets the end date, which is the termination date of the FRA.

        This is the last day that interest accrues. This date must be after the start 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:
        endDate - the new value, not null
        Returns:
        this, for chaining, not null
      • businessDayAdjustment

        public Fra.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
      • paymentDate

        public Fra.Builder paymentDate​(AdjustableDate paymentDate)
        Sets the payment date.

        The payment date is typically the same as the start date. The date may be subject to adjustment to ensure it is a business day.

        When building, this will default to the start date with no adjustments if not specified.

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

        public Fra.Builder fixedRate​(double fixedRate)
        Sets the fixed rate of interest. A 5% rate will be expressed as 0.05.

        See buySell to determine whether this rate is paid or received.

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

        public Fra.Builder index​(IborIndex index)
        Sets the Ibor index.

        The floating rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'. This will be used throughout unless indexInterpolated is present.

        See buySell to determine whether this rate is paid or received.

        Parameters:
        index - the new value, not null
        Returns:
        this, for chaining, not null
      • indexInterpolated

        public Fra.Builder indexInterpolated​(IborIndex indexInterpolated)
        Sets the second Ibor index to be used for linear interpolation, optional.

        This will be used with index to linearly interpolate the rate. It will be a well known market index such as 'GBP-LIBOR-6M'. This index may be shorter or longer than index, but not the same.

        Parameters:
        indexInterpolated - the new value
        Returns:
        this, for chaining, not null
      • fixingDateOffset

        public Fra.Builder fixingDateOffset​(DaysAdjustment fixingDateOffset)
        Sets the offset of the fixing date from the start date.

        The offset is applied to the start date and is typically minus 2 business days. The data model permits the offset to differ from that of the index, however the two are typically the same.

        When building, this will default to the fixing date offset of the index if not specified.

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

        public Fra.Builder dayCount​(DayCount dayCount)
        Sets the day count convention applicable, defaulted to the day count of the index.

        This is used to convert dates to a numerical value. The data model permits the day count to differ from that of the index, however the two are typically the same.

        When building, this will default to the day count of the index if not specified.

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

        public Fra.Builder discounting​(FraDiscountingMethod discounting)
        Sets the method to use for discounting, defaulted to 'ISDA' or 'AFMA'.

        There are different approaches FRA pricing in the area of discounting. This method specifies the approach for this FRA.

        When building, this will default 'AFMA' if the index has the currency 'AUD' or 'NZD' and to 'ISDA' otherwise.

        Parameters:
        discounting - 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<Fra>