private BulletPaymentTrade(TradeInfo info, BulletPayment product)
 {
     JodaBeanUtils.notNull(info, "info");
     JodaBeanUtils.notNull(product, "product");
     this.info    = info;
     this.product = product;
 }
示例#2
0
        public virtual void test_resolve_receive()
        {
            BulletPayment         test     = BulletPayment.builder().payReceive(PayReceive.RECEIVE).value(GBP_P1000).date(AdjustableDate.of(DATE_2015_06_30)).build();
            ResolvedBulletPayment expected = ResolvedBulletPayment.of(Payment.of(GBP_P1000, DATE_2015_06_30));

            assertEquals(test.resolve(REF_DATA), expected);
        }
示例#3
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            BulletPayment test = BulletPayment.builder().payReceive(PayReceive.PAY).value(GBP_P1000).date(AdjustableDate.of(DATE_2015_06_30)).build();

            coverImmutableBean(test);
            BulletPayment test2 = BulletPayment.builder().payReceive(PayReceive.RECEIVE).value(USD_P1600).date(AdjustableDate.of(DATE_2015_06_29)).build();

            coverBeanEquals(test, test2);
        }
示例#4
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            BulletPayment test = BulletPayment.builder().payReceive(PayReceive.PAY).value(GBP_P1000).date(AdjustableDate.of(DATE_2015_06_30)).build();

            assertEquals(test.PayReceive, PayReceive.PAY);
            assertEquals(test.Value, GBP_P1000);
            assertEquals(test.Date, AdjustableDate.of(DATE_2015_06_30));
            assertEquals(test.Currency, GBP);
            assertEquals(test.CrossCurrency, false);
            assertEquals(test.allPaymentCurrencies(), ImmutableSet.of(GBP));
            assertEquals(test.allCurrencies(), ImmutableSet.of(GBP));
        }
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         BulletPayment other = (BulletPayment)obj;
         return(JodaBeanUtils.equal(payReceive, other.payReceive) && JodaBeanUtils.equal(value, other.value) && JodaBeanUtils.equal(date, other.date));
     }
     return(false);
 }
            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 = (BulletPayment)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
示例#7
0
        public virtual void test_serialization()
        {
            BulletPayment test = BulletPayment.builder().payReceive(PayReceive.PAY).value(GBP_P1000).date(AdjustableDate.of(DATE_2015_06_30)).build();

            assertSerialization(test);
        }
示例#8
0
 public virtual void test_builder_notNegative()
 {
     assertThrowsIllegalArg(() => BulletPayment.builder().payReceive(PayReceive.PAY).value(GBP_M1000).date(AdjustableDate.of(DATE_2015_06_30)).build());
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance of a Bullet Payment trade.
 /// </summary>
 /// <param name="info">  the trade info </param>
 /// <param name="product">  the product </param>
 /// <returns> the trade </returns>
 public static BulletPaymentTrade of(TradeInfo info, BulletPayment product)
 {
     return(new BulletPaymentTrade(info, product));
 }
 /// <summary>
 /// Sets the 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(BulletPayment 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(BulletPaymentTrade beanToCopy)
 {
     this.info_Renamed    = beanToCopy.Info;
     this.product_Renamed = beanToCopy.Product;
 }