/// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ResolvedIborFutureTrade beanToCopy)
 {
     this.info_Renamed        = beanToCopy.Info;
     this.product_Renamed     = beanToCopy.Product;
     this.quantity_Renamed    = beanToCopy.Quantity;
     this.tradedPrice_Renamed = beanToCopy.tradedPrice;
 }
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            IborFuture         test     = sut();
            ResolvedIborFuture expected = ResolvedIborFuture.builder().securityId(SECURITY_ID).currency(USD).notional(NOTIONAL).accrualFactor(ACCRUAL_FACTOR).iborRate(IborRateComputation.of(USD_LIBOR_3M, LAST_TRADE_DATE, REF_DATA)).rounding(ROUNDING).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3237038:         // info
                    this.info_Renamed = (PortfolioItemInfo)newValue;
                    break;

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

                case -1285004149:         // quantity
                    this.quantity_Renamed = (double?)newValue.Value;
                    break;

                case -1873824343:         // tradedPrice
                    this.tradedPrice_Renamed = (TradedPrice)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
 /// <summary>
 /// Creates an instance. </summary>
 /// <param name="info">  the value of the property, not null </param>
 /// <param name="product">  the value of the property, not null </param>
 /// <param name="quantity">  the value of the property </param>
 /// <param name="tradedPrice">  the value of the property </param>
 internal ResolvedIborFutureTrade(PortfolioItemInfo info, ResolvedIborFuture product, double quantity, TradedPrice tradedPrice)
 {
     JodaBeanUtils.notNull(info, "info");
     JodaBeanUtils.notNull(product, "product");
     this.info        = info;
     this.product     = product;
     this.quantity    = quantity;
     this.tradedPrice = tradedPrice;
 }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ResolvedIborFutureOption beanToCopy)
 {
     this.securityId_Renamed       = beanToCopy.SecurityId;
     this.putCall_Renamed          = beanToCopy.PutCall;
     this.strikePrice_Renamed      = beanToCopy.StrikePrice;
     this.expiry_Renamed           = beanToCopy.Expiry;
     this.premiumStyle_Renamed     = beanToCopy.PremiumStyle;
     this.rounding_Renamed         = beanToCopy.Rounding;
     this.underlyingFuture_Renamed = beanToCopy.UnderlyingFuture;
 }
        public ResolvedIborFutureTrade resolve(ReferenceData refData)
        {
            if (!info.TradeDate.Present)
            {
                throw new System.ArgumentException("Trade date on TradeInfo must be present");
            }
            ResolvedIborFuture resolved    = Product.resolve(refData);
            TradedPrice        tradedPrice = TradedPrice.of(info.TradeDate.get(), price);

            return(new ResolvedIborFutureTrade(info, resolved, quantity, tradedPrice));
        }
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedIborFuture test = sut();

            assertEquals(test.Currency, PRODUCT.Currency);
            assertEquals(test.Notional, PRODUCT.Notional);
            assertEquals(test.AccrualFactor, PRODUCT.AccrualFactor);
            assertEquals(test.LastTradeDate, PRODUCT.LastTradeDate);
            assertEquals(test.Index, PRODUCT.Index);
            assertEquals(test.Rounding, PRODUCT.Rounding);
            assertEquals(test.IborRate, IborRateComputation.of(PRODUCT.Index, PRODUCT.LastTradeDate, REF_DATA));
        }
        public virtual void test_builder_defaults()
        {
            ResolvedIborFuture test = ResolvedIborFuture.builder().securityId(SECURITY_ID).currency(GBP).notional(NOTIONAL).iborRate(IborRateComputation.of(GBP_LIBOR_2M, LAST_TRADE_DATE, REF_DATA)).build();

            assertEquals(test.Currency, GBP);
            assertEquals(test.Notional, NOTIONAL);
            assertEquals(test.AccrualFactor, ACCRUAL_FACTOR_2M);
            assertEquals(test.LastTradeDate, LAST_TRADE_DATE);
            assertEquals(test.Index, GBP_LIBOR_2M);
            assertEquals(test.Rounding, Rounding.none());
            assertEquals(test.IborRate, IborRateComputation.of(GBP_LIBOR_2M, LAST_TRADE_DATE, REF_DATA));
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedIborFuture other = (ResolvedIborFuture)obj;
         return(JodaBeanUtils.equal(securityId, other.securityId) && JodaBeanUtils.equal(currency, other.currency) && JodaBeanUtils.equal(notional, other.notional) && JodaBeanUtils.equal(accrualFactor, other.accrualFactor) && JodaBeanUtils.equal(iborRate, other.iborRate) && JodaBeanUtils.equal(rounding, other.rounding));
     }
     return(false);
 }
 /// <summary>
 /// Creates an instance. </summary>
 /// <param name="securityId">  the value of the property, not null </param>
 /// <param name="putCall">  the value of the property </param>
 /// <param name="strikePrice">  the value of the property </param>
 /// <param name="expiry">  the value of the property, not null </param>
 /// <param name="premiumStyle">  the value of the property, not null </param>
 /// <param name="rounding">  the value of the property, not null </param>
 /// <param name="underlyingFuture">  the value of the property, not null </param>
 internal ResolvedIborFutureOption(SecurityId securityId, PutCall putCall, double strikePrice, ZonedDateTime expiry, FutureOptionPremiumStyle premiumStyle, Rounding rounding, ResolvedIborFuture underlyingFuture)
 {
     JodaBeanUtils.notNull(securityId, "securityId");
     JodaBeanUtils.notNull(expiry, "expiry");
     JodaBeanUtils.notNull(premiumStyle, "premiumStyle");
     JodaBeanUtils.notNull(rounding, "rounding");
     JodaBeanUtils.notNull(underlyingFuture, "underlyingFuture");
     this.securityId       = securityId;
     this.putCall          = putCall;
     this.strikePrice      = strikePrice;
     this.expiry           = expiry;
     this.premiumStyle     = premiumStyle;
     this.rounding         = rounding;
     this.underlyingFuture = underlyingFuture;
     validate();
 }
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 1574023291:         // securityId
                    this.securityId_Renamed = (SecurityId)newValue;
                    break;

                case -219971059:         // putCall
                    this.putCall_Renamed = (PutCall)newValue;
                    break;

                case 50946231:         // strikePrice
                    this.strikePrice_Renamed = (double?)newValue.Value;
                    break;

                case -1289159373:         // expiry
                    this.expiry_Renamed = (ZonedDateTime)newValue;
                    break;

                case -1257652838:         // premiumStyle
                    this.premiumStyle_Renamed = (FutureOptionPremiumStyle)newValue;
                    break;

                case -142444:         // rounding
                    this.rounding_Renamed = (Rounding)newValue;
                    break;

                case -165476480:         // underlyingFuture
                    this.underlyingFuture_Renamed = (ResolvedIborFuture)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
        //-------------------------------------------------------------------------
        public ResolvedIborFutureOption resolve(ReferenceData refData)
        {
            ResolvedIborFuture resolved = underlyingFuture.resolve(refData);

            return(new ResolvedIborFutureOption(securityId, putCall, strikePrice, Expiry, premiumStyle, rounding, resolved));
        }
        public ResolvedIborFutureTrade resolve(ReferenceData refData)
        {
            ResolvedIborFuture resolved = product.resolve(refData);

            return(new ResolvedIborFutureTrade(info, resolved, Quantity, null));
        }
        public virtual void test_builder_noCurrency()
        {
            ResolvedIborFuture test = ResolvedIborFuture.builder().securityId(SECURITY_ID).notional(NOTIONAL).iborRate(IborRateComputation.of(GBP_LIBOR_2M, LAST_TRADE_DATE, REF_DATA)).rounding(ROUNDING).build();

            assertEquals(GBP, test.Currency);
        }
 public virtual void test_builder_noObservation()
 {
     assertThrowsIllegalArg(() => ResolvedIborFuture.builder().securityId(SECURITY_ID).notional(NOTIONAL).currency(GBP).rounding(ROUNDING).build());
 }
 /// <summary>
 /// Sets the underlying future. </summary>
 /// <param name="underlyingFuture">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder underlyingFuture(ResolvedIborFuture underlyingFuture)
 {
     JodaBeanUtils.notNull(underlyingFuture, "underlyingFuture");
     this.underlyingFuture_Renamed = underlyingFuture;
     return(this);
 }
 /// <summary>
 /// Sets the future that was traded.
 /// <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(ResolvedIborFuture product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }