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 = (ResolvedBondFutureOption)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);
            }
Пример #2
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            BondFutureOption         test     = sut();
            ResolvedBondFutureOption expected = ResolvedBondFutureOption.builder().securityId(SECURITY_ID).putCall(CALL).strikePrice(STRIKE_PRICE).expiry(EXPIRY_DATE.atTime(EXPIRY_TIME).atZone(EXPIRY_ZONE)).premiumStyle(FutureOptionPremiumStyle.DAILY_MARGIN).underlyingFuture(FUTURE.resolve(REF_DATA)).build();

            assertEquals(test.resolve(REF_DATA), expected);
        }
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ResolvedBondFutureOptionTrade beanToCopy)
 {
     this.info_Renamed        = beanToCopy.Info;
     this.product_Renamed     = beanToCopy.Product;
     this.quantity_Renamed    = beanToCopy.Quantity;
     this.tradedPrice_Renamed = beanToCopy.tradedPrice;
 }
 /// <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 ResolvedBondFutureOptionTrade(PortfolioItemInfo info, ResolvedBondFutureOption 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;
 }
        public ResolvedBondFutureOptionTrade resolve(ReferenceData refData)
        {
            if (!info.TradeDate.Present)
            {
                throw new System.ArgumentException("Trade date on TradeInfo must be present");
            }
            ResolvedBondFutureOption resolved = Product.resolve(refData);
            TradedPrice tradedPrice           = TradedPrice.of(info.TradeDate.get(), price);

            return(new ResolvedBondFutureOptionTrade(info, resolved, quantity, tradedPrice));
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedBondFutureOption other = (ResolvedBondFutureOption)obj;
         return(JodaBeanUtils.equal(securityId, other.securityId) && JodaBeanUtils.equal(putCall, other.putCall) && JodaBeanUtils.equal(strikePrice, other.strikePrice) && JodaBeanUtils.equal(expiry, other.expiry) && JodaBeanUtils.equal(premiumStyle, other.premiumStyle) && JodaBeanUtils.equal(rounding, other.rounding) && JodaBeanUtils.equal(underlyingFuture, other.underlyingFuture));
     }
     return(false);
 }
Пример #7
0
        public ResolvedBondFutureOptionTrade resolve(ReferenceData refData)
        {
            ResolvedBondFutureOption resolved = product.resolve(refData);

            return(new ResolvedBondFutureOptionTrade(info, resolved, Quantity, null));
        }
Пример #8
0
        //-------------------------------------------------------------------------
        public virtual void test_getters()
        {
            ResolvedBondFutureOption test = sut();

            assertEquals(test.ExpiryDate, test.Expiry.toLocalDate());
        }
 /// <summary>
 /// Sets the option 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(ResolvedBondFutureOption product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }