//-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            Swaption test = sut();

            assertEquals(test.ExpiryDate, ADJUSTABLE_EXPIRY_DATE);
            assertEquals(test.ExpiryTime, EXPIRY_TIME);
            assertEquals(test.ExpiryZone, ZONE);
            assertEquals(test.Expiry, EXPIRY_DATE.atTime(EXPIRY_TIME).atZone(ZONE));
            assertEquals(test.LongShort, LONG);
            assertEquals(test.SwaptionSettlement, PHYSICAL_SETTLE);
            assertEquals(test.Underlying, SWAP);
            assertEquals(test.Currency, USD);
            assertEquals(test.Index, IborIndices.USD_LIBOR_3M);
            assertEquals(test.CrossCurrency, false);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(USD));
            assertEquals(test.allCurrencies(), ImmutableSet.of(USD));
        }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3237038:         // info
                    this.info_Renamed = (TradeInfo)newValue;
                    break;

                case -309474065:         // product
                    this.product_Renamed = (Swaption)newValue;
                    break;

                case -318452137:         // premium
                    this.premium_Renamed = (AdjustablePayment)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
 /// <summary>
 /// Obtains an instance of a Swaption trade with an adjustable payment.
 /// </summary>
 /// <param name="info">  the trade info </param>
 /// <param name="product">  the product </param>
 /// <param name="premium">  the premium </param>
 /// <returns> the trade </returns>
 public static SwaptionTrade of(TradeInfo info, Swaption product, AdjustablePayment premium)
 {
     return(new SwaptionTrade(info, product, premium));
 }
 /// <summary>
 /// Sets the swaption product that was agreed when the trade occurred.
 /// <para>
 /// The product captures the contracted financial details of the trade.
 /// </para>
 /// </summary>
 /// <param name="product">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder product(Swaption product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(SwaptionTrade beanToCopy)
 {
     this.info_Renamed    = beanToCopy.Info;
     this.product_Renamed = beanToCopy.Product;
     this.premium_Renamed = beanToCopy.Premium;
 }
 public virtual void test_builder_invalidSwapBasis()
 {
     assertThrowsIllegalArg(() => Swaption.builder().expiryDate(ADJUSTABLE_EXPIRY_DATE).expiryTime(EXPIRY_TIME).expiryZone(ZONE).longShort(LONG).swaptionSettlement(PHYSICAL_SETTLE).underlying(SWAP_BASIS).build());
 }
 public virtual void test_builder_expiryAfterStart()
 {
     assertThrowsIllegalArg(() => Swaption.builder().expiryDate(AdjustableDate.of(LocalDate.of(2014, 6, 17), ADJUSTMENT)).expiryTime(EXPIRY_TIME).expiryZone(ZONE).longShort(LONG).swaptionSettlement(PHYSICAL_SETTLE).underlying(SWAP).build());
 }
 internal static Swaption sut2()
 {
     return(Swaption.builder().expiryDate(AdjustableDate.of(LocalDate.of(2014, 6, 10), ADJUSTMENT)).expiryTime(LocalTime.of(14, 0)).expiryZone(ZoneId.of("GMT")).longShort(SHORT).swaptionSettlement(CASH_SETTLE).underlying(FixedIborSwapConventions.USD_FIXED_6M_LIBOR_3M.createTrade(LocalDate.of(2014, 6, 10), Tenor.TENOR_10Y, BuySell.BUY, 1d, FIXED_RATE, REF_DATA).Product).build());
 }
 //-------------------------------------------------------------------------
 internal static Swaption sut()
 {
     return(Swaption.builder().expiryDate(ADJUSTABLE_EXPIRY_DATE).expiryTime(EXPIRY_TIME).expiryZone(ZONE).longShort(LONG).swaptionSettlement(PHYSICAL_SETTLE).underlying(SWAP).build());
 }